|
-
Oct 8th, 2001, 07:27 AM
#1
Thread Starter
Lively Member
.addnew with ASP
how do I insert data to me db using .addnew and .update
how must I define my recordset etc.
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Oct 8th, 2001, 10:43 AM
#2
Hyperactive Member
Ooops!!
Code:
<%
Dim objConn, rsRec
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath ("Database.mdb")
Set rsRec = Server.CreateObject("ADODB.Recordset")
rsRec.Open "Table1", objConn, 1, 3
rsRec.AddNew
rsRec("Field1") = Request.Form("txtBox1")
rsRec("Field2") = Request.Form("txtBox2")
rsRec.Update
rsRec.Close
objConn.Close
Set rsRec = Nothing
Set objConn = Nothing
%>
Hope this helps!!
Last edited by davidgottlieb; Oct 8th, 2001 at 12:10 PM.
Thanks Alot,
David Gottlieb
CIW Certified Internet Webmaster
Web Developer/Designer
-
Oct 8th, 2001, 12:00 PM
#3
Good Ol' Platypus
You can also specify a DSN in the ODBC icon of the Control Panel. It sometimes is easier but sometimes slower as well.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Oct 8th, 2001, 12:03 PM
#4
Hyperactive Member
IT is also a real *****. I would stick with ADO.
Thanks Alot,
David Gottlieb
CIW Certified Internet Webmaster
Web Developer/Designer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|