Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable save to database...

Status
Not open for further replies.

immotal

Technical User
Sep 1, 2003
9
SG
Hiyya, can anybody pls help me out wif dis asp codes? I found no error wif it... but the fact tad the information keyed in cannot be saved to the database is killing me... could anybody pls tell me wad else could be wrong? below is the codes...

<%
dim err
dim conn
dim rs
dim strBuffer1,strBuffer2
dim varDatabaseName
dim sql

varDatabaseName=&quot;db2.mdb&quot;

strBuffer1 = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source= &quot;
strBuffer2 = server.mappath(varDatabaseName)

set conn = server.createobject(&quot;ADODB.connection&quot;)
conn.connectionstring = strBuffer1 & strBuffer2
conn.open
set rs = server.createobject(&quot;ADODB.recordset&quot;)
rs.open &quot;friens&quot;, conn, adLockOptimistic, ,adCmdTable

rs.AddNew
rs(&quot;FirstName&quot;)=Request.Form(&quot;FirstName&quot;)
rs(&quot;LastName&quot;)=Request.Form(&quot;LastName&quot;)
rs(&quot;Gender&quot;)=Request.Form(&quot;Gender&quot;)
rs(&quot;Age&quot;)=Request.Form(&quot;Age&quot;)
rs(&quot;Email&quot;)=Request.Form(&quot;Email&quot;)
rs.Update

response.write &quot;can be save&quot;
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

the page will print me &quot;can be saved&quot; but then there is no data stored in the database. i m using microsoft access btw.. thanx...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top