View Full Version : ADODB.Connection.1 error '80004005'
The69Pimp
01-18-2003, 08:30 AM
ADODB.Connection.1 error '80004005'
SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified
changed.asp, line 8
here are lines 1-10
<%
closed = 0
if closed = 0 Then
'///////////////////////////////////////////////////////////////////////////////////
'connection string
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "getdata"
can someone PLEASE help me
bostjank
01-18-2003, 10:27 AM
You need to specify the driver and the database after you create ADODB object and before you open it. If you use Access you can use
Set conn = Server.CreateObject("adodb.connection")
sConn = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " & Server.MapPath("FILE NAME")
conn. Open sConn
Bostjan
The69Pimp
01-18-2003, 11:08 AM
same error different line it is now saying
ADODB.Connection.1 error '80004005'
SQLState: IM002
Native Error Code: 0
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified
changed.asp, line 9
Set conn = Server.CreateObject("adodb.connection")
sConn = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source= " & Server.MapPath("finalchaos.mdb")
conn. Open sConn
conn. Open sConn is line 9
bostjank
01-18-2003, 11:18 AM
Is your database in the same directory as the ASP page? Otherwise you must specify the path too.
If your page is in root folder and database in "db" folder you shoud specify path like "db/finalchaos.mdb"
Bostjan
The69Pimp
01-18-2003, 11:19 AM
the db is right in the root directry!!!! :( please help me
bostjank
01-18-2003, 12:06 PM
Then try this to open the database
sConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("finalchaos.mdb")
Bostjan
bostjank
01-18-2003, 12:38 PM
You may also check out this page - it deals with db errors
http://www.aspfaq.com/2009
Bostjan
The69Pimp
01-18-2003, 12:42 PM
ok now i get this
i have
sConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("finalchaos.mdb")
set MyConn = Server.CreateObject("ADODB.Connection")
in changed.asp
then i get
ADODB.Connection.1 error '800a0e78'
Invalid operation on closed object
/index.asp, line 10
on index.asp
this is what line 10 is on index
SQL = "SELECT ID FROM Members ORDER BY ID DESC"
Set RS = MyConn.Execute(SQL)
im executing it on line 10 whats wrong?????
bostjank
01-18-2003, 12:56 PM
You forgot
MyConn.open sConn
Bostjan
The69Pimp
01-18-2003, 12:58 PM
now i get
ADODB.Connection.1 error '800a0bb9'
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
changed.asp, line 9
this is 7,8,9
sConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("finalchaos.mdb")
Set Myconn = Server.CreateObject("adodb.connection")
MyConn.open sConn
bostjank
01-18-2003, 03:29 PM
Two questions:
Does your ISP support MS Access?
Is your MDB file valid Access file?
Bostjan
The69Pimp
01-18-2003, 03:47 PM
yes and yes
i made this game a few months ago, had it running then lost my isp and took it down, just got it back and now i cant run it because i cant get this to work
bostjank
01-18-2003, 06:34 PM
If it woked I'd bet there is something wrong on the server of your ISP.
Bostjan
aCcodeMonkey
01-20-2003, 08:42 AM
OLEDB is looking for a Provider not a driver.
Try this connection. Also if you look I am specifically telling Server.MapPath() to look in ght root directory by adding the "/" to the filename.
Dim oConn,oRs,sSQL
Set oConn = Server.CreateObject("ADODB.CONNECTION")
set oRs = Server.CreateObject("ADODB.RECORDSET")
oConn.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=" & Server.MapPath("/finalchaos.mdb")
oConn.Open
sSQL = "SELECT ID FROM Members ORDER BY ID DESC"
oRs.Open sSQL,oConn,2,1
Do While Not oRs.EOF
Response.Write(oRs.Fields("ID").value & "<BR>")
oRs.MoveNext
Loop
Hope this helps :cool:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.