 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 19th, 2004, 03:52 PM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can Any One Suggest ME(ASP Database)?
Hi all,
I get the following error when i try to insert records into MS.Access Database
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Driver={Microsoft Ac'
/test/savenewuser.asp, line 24
my code is as follow
<%
dim objConn, objrecordset, strSql
dim uid, fname, lname, password, email
uid = request.Form("txtuserid")
fname = request.Form("txtfname")
lname = request.Form("txtlname")
password = request.Form("txtpassword")
email = request.Form("txtemail")
objConn = "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"
set objrecordset = server.createobject("ADODB.recordset")
strSql = "INSERT INTO tbllogin(userid, fname, lname, password, email) values('"& uid &"', '"& fname &"', '"& lname &"', '"& password &"', '"& email &"')"
objrecordset.open strSql, objconn
objConn.close
set objrecordset = nothing
%>
Thanks in advance
|
|

March 19th, 2004, 04:43 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
set objconn = Server.CreateObject("ADODB.Connection")
objConn = "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"
Also, I always liked this instead of hard coding the path:
objConn = "Driver={Microsoft Access Driver (*.MDB)};DBQ=" & _
Server.MapPath("LogDatabase.mdb")
|
|

March 19th, 2004, 04:48 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry... It should be:
set objconn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={Microsoft Access Driver (*.MDB)}; DBQ=C:/Inetpub/wwwroot/test/LogDatabase.mdb"
OR:
objConn = "Driver={Microsoft Access Driver (*.MDB)};DBQ=" & _
Server.MapPath("LogDatabase.mdb")
An aside: Where is the edit post button?
|
|

March 19th, 2004, 08:12 PM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
U.N.C.L.E. Thank for the help.
can you tell me if i have to put that connection string in globale.asa, how do i do that?
thanks in advance
|
|

March 19th, 2004, 09:54 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You don't have to do that, you can define a global variable with it in it, or use an include file that defines it (latter is popular choice).
|
|

March 20th, 2004, 05:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
quote:An aside: Where is the edit post button?
|
It's on the top of each message you posted. It's the third button (the middle one) and has a pencil on it.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |