Προς το περιεχόμενο

Connect ASP DAtabase And Adding Records


tgalanopoulos

Προτεινόμενες αναρτήσεις

Δημοσ.

Geias bre pedia. Ante na doume 4 mines i selida mou kato giati? Giati den ksero opli kala asp frown.gif" border="0 Exo kanei mia forma me pedia opu me auton ton tropo tha simplirono ta pedia ki molis tha patao to koumpi insert tha pigenei sto allo arxeio insertrecord.asp kai tha prosthetei tin eggrafi.<P>Mexri tora to formmadd mia xara molis pao na kano insert den mporei na tin eisagei.<P><BR>sas dino parakato analitika ton kodika tou kathe arxeiou gia na deite pos exei. ypopsin ta permissions einai ok kai to virtual directory .<P>FORMADD.ASP<P><BR><html><head><BR><title>Insert Records To Database</title><BR></head><BR><body><P><BR><form name="Insert Records To Database" method="Post" action="insertrecord.asp"><BR><center><table><P><tr><td><b>Group Artist: </td><BR><td><input type="text" name="GroupArtist" size="60"></td></tr><P><tr><td><b>Title: </td><BR><td><input type="text" name="Title" size="60"></td></tr><P><tr><td><b>CD: </td><BR><td><input type="text" name="CD" size="6"></td></tr><P><tr><td><b>Quantity: </td><BR><td><input type="text" name="Quantity" size="1"></td></tr><P><tr><td><b>TotalTracksPerCd: </td><BR><td><input type="text" name="TotalTracksPerCd" size="2"></td></tr><P><tr><td><b>Gender: </td><BR><td><input type="text" name="Gender" size="30"></td></tr><P></table><P><input type="Submit" name="Submit" value="Insert Record"><BR></form><BR></center><P></body><BR></html><P><BR>INSERTRECORD.ASP<P><BR><%@ Language=VBScript %><BR><% Option Explicit %><BR><!--#INCLUDE VIRTUAL="adovbs.inc" --><P>Dim myconn<BR>Dim RS<BR>Dim strGroupArtist<BR>Dim strTitle<BR>Dim strCD<BR>Dim strQuantity<BR>Dim strTotalTracksPerCD<BR>Dim strGender<P>strGroupArtist = Request.Form("GroupArtist")<BR>strTitle = Request.Form("Title")<BR>strCD = Request.Form("CD")<BR>strQuantity = Request.Form("Quantity")<BR>strTotalTracksPerCD = Request.Form("TotalTracksPerCD")<BR>strGender = Request.Form("Gender")<P>Set MyConn=Server.CreateObject("ADODB.Connection")<BR>Set RS=Server.CreateObject("ADODB.RecordSet")<P>MyConn.open "cds"<P>RS.Open "Select * From Table", MyConn, adOpenDynamic, adLockPessimistic, adCMDText<P>RS.AddNew<BR>RS("GroupArtist")= strGroupArtist<BR>RS("Title")= strTitle<BR>RS("CD")= strCD<BR>RS("Quantity")= strQuantity<BR>RS("TotalTracksPerCD")= strTotalTracksPerCD<BR>RS("Gender")= strGender<BR>RS.Update<P>RS.Close<BR>MyConn.Close<BR>Set RS = Nothing<BR>Set MyConn = Nothing<BR>%><P><BR>perito na sas po oti to insert record .asp to exo kanei kai me diaforetikous tropous.<P>alla tothema einai oti den tin kanei add tin eggrafi.<P>Xrisimopoio win 98 kai klasika personal web server.<P>An mporei kapios na me boithisei tha to ektimousa para poli <P>sas eyxaristo ek ton proteron<P> frown.gif" border="0 frown.gif" border="0 frown.gif" border="0 frown.gif" border="0 frown.gif" border="0 frown.gif" border="0

Δημοσ.

tgalanopoulos,<P>1) To FORMADD.ASP den exei logo na einai asp mias kai einai apli HTML.<BR>2)Stin asp den diloneis se poio table/database na sindetheis<BR>3)Episis den diloneis username kai pass (an den epitrepei to anonymous logon kai o anonymous na exei select kai insert dikeomata auto tha odigisei se error)<BR>4)An mporeis kane mas ena copy paste to sfalma pou sou bgazei o browser sou.<P>Filika Johnis.

Δημοσ.

file gianni se eyxaristo gia to endiaferon sou :><BR>as ta paroume siga siga ta pragmata kai ena ena :><P>1) To FORMADD.ASP den exei logo na einai asp mias kai einai apli HTML.<P>orea dld mporo to formadd.asp na to kano mia apli html. pos apo kei mesa kalo to insertrecord.asp? me aplo link mou naigei ton browser kai mou deixnei ton kodika tou insertrecord opote tha einai kapia diaforetiki sindesi metaksi tous san link ksereis pos na ta linkaro? kai kati allo stin asp genika i arxiki selida ti prepei na einai se onoma opos leme se html index i home i arxiki stin aso pos einai? kai an prepei na onomaso ego kamia i na tis onomazo opos thelo ?<P><BR>2)Stin asp den diloneis se poio table/database na sindetheis<P>nai exeis dikio to exo kanei kai auto pou les alla mou ebgaze ena error. den ekane mesa ston kodika connect tin database eno tou eixa dosei ta sxetika server.mappath kai pinakes kai databases sou leo to exo kanei me xilious diaforetikous tropous.tora den kseor epidi katebazo samples apo net an o ISS einai idia GLosa me to PWs , diladi an oi sindeseis ston kodika einai oi idies entoles katalabes? ego xrisimopoio PWS win 98 :><P><BR>3)Episis den diloneis username kai pass (an den epitrepei to anonymous logon kai o anonymous na exei select kai insert dikeomata auto tha odigisei se error)<P><BR>Oson afora auto den ksero ego thelo na kano mia apli database na parousiazo eggrafes. asxeta oti meta tha kano ena link gia mena pou tha tou dino to password mou kai tha mpeno na kataxoro. Alla se auti tin apli sindesi kai eisagogi eggrafis se mia database prepei pali na kano anonimous login k.t.l dld na balo permissions? kai apo pou ta bazo auta?<P>4)An mporeis kane mas ena copy paste to sfalma pou sou bgazei o browser sou.<P>oso giauto epidi den exo xrono tora tha ksanaftiakso to file kai tha to trkso kai an einai tha sto steilo ma mail na deis ti problima mou bgazei.<P><BR>Liga info gia ton server pou exo brei oste na kano upload tin basi mou gia des ti ipostirizei.<P>30 Mb Disk Space <BR>FTP Access Account <BR>Unlimited Bandwidth <BR>No Set Up Charges! <BR>Standard ASP Scripts <BR>No Monthly Fees! <BR>Free ODBC System DSN Setup <BR> <P>auta ta oliga file pisteuo na se katatopisa kapos kai perimeno nea sou filika teo :>

Δημοσ.

A kai pou se jonny exei sxesi pou o server autos o hoster ypostirizei win 2000 kai go to ftiaxno se PWS? kai kati allo epidi exo teliosei baseis dedomenon kai kala :> i access ypostirizei sql statments xalara otan omos pao na balo ston kodika sql entoles mou xtipane. Mipos prepei na katso pano ama thelo teties entoles ton SQL Server 7.0?<P>Koita oti ksereis perimeno na me katatopiseis.<P>exo ena books tis vb6 pou sta last kefalea leei gia asp merika pragmata alla xtes meso net parageila kai to asp 3.0 giati toso kairo pou psaxno exo dei kai exo mperdeutei alla lei o enas alla o allos me xiliades tropous kai eimai skata man frown.gif" border="0<P>se eyxaristo kai ta leme

Δημοσ.

tgalanopoulos,<P>Na paroume ligo ta pragmata apo tin arxi.<BR>Gia na sindeseis mia asp me mia database kai na doulepsei to olo thema ston ipologisti sou prepei na ftiakseis enan ODBC odigo.<BR>An den iparxei autos o odigos den mporeis na diloseis pos tha sindetheis me ti basi.<BR>Pigene loipon Control Panel -> ODBC DATA SOURCES kai des an iparxei DSN tis basis pou theleis na xrisimopiiseis.An iparxei tote eisai ok.An den iparxei prepei na dimiourgiseis ena. Tora gia Access den ksero tis rithmiseis ktl para mono gia mysql pou katexo.<BR>Eipes pos i access ipostirizei sql commands. Ligo xlomo mou fenete.Ksero oti ipostirizei standar VB alla gia sql... rolleyes.gif" border="0 !<BR>Eipes oti douleueis me PWs.Den exo idea ti einai.Prosopika douleuo mono me IIS.<BR>Sigoura prin sikoseis mia basi sto internet prepei na exeis dosei permissions analoga me to ti thes o telikos xristis na exei.Px an thes mono na emfaniseis ena table prepei na dimiourgiseis ena user pou tha exei Select dikeomata kai tipota allo!Pos bazeis permissions stin Access den ksero.Den exo poliasxolithei me auti.Gia web database xrisimopoio tin MySQL.Stin SQL einai eukolo na doseis apla permissions.<BR>Ena paradeigma gia to pos sindeeis mia sql database se mia asp einai to eksis:<BR><%<BR>Dim rstTable<BR>Dim mConn<BR>Dim mCmd<P>Set mConn = Server.CreateObject("ADODB.Connection")<BR>Set mCmd = Server.CreateObject("ADODB.Command")<BR>Set rstTable = Server.CreateObject("ADODB.Recordset")<P>mConn.ComandTimeout = 40<BR>mConn.CursorLocation = 1<BR>'o parakato kodikas dilonei dsn,database,user k pass<BR>mConn.ConnectionString = "server=Localhost;driver=MySQL;db=databasename;uid=Tousername;pwd=okodikos"<BR>mConn.Open<BR>mCmd.ActiveConnection = mConn<BR>mCmd.CommandType = 1 'dilonei oti tha dinei promt entoles<BR>mCmd.CommandText = "SELECT * FROM onomatable"<BR>rstTable.Open mCmd,,,1<BR>%><P>Tora gia to FORMADD.ASP, an to metonomaseis se FORMADD.HTM i FORMADD.HTML otan to sikoseis sto net i otan to trekseis meso IIS kai oxi san apli htm selida(kanonta double click) tha kaei oti akribos theleis.<P>Den ksero kata poso apantisa stis apories sou.Aurio pou tha me pio ksekourastos tha simpliroso an ksexasa kati. wink.gif" border="0<p>[ 23-11-2001: Message edited by: Johnis ]

Δημοσ.

gianni nai man an pas stin access sta modules pou exei vb code mporeis ekei mesa na xoseis sql commands.<P>Anyway dns exo ftiaksei alla den ksero pou kolaei to olo skiniko kai den kanei add tin eggrafi.<P>Anywayz filarako euxaristo gia ton xrono sou sou eixa pei kai oti exo paragilei to book asp 3.0 kai kati tha bgalo apo kei mesa sigoura tora oson afora to pws VS iis pisteuo oti o iis einai kaliteros alla den exo tis dinatotites hardware man<P>ta leme :>

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...