...

View Full Version : ADODB.Connection.1 error '80004005'



The69Pimp
01-18-2003, 07: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, 09: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, 10: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, 10: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, 10:19 AM
the db is right in the root directry!!!! :( please help me

bostjank
01-18-2003, 11:06 AM
Then try this to open the database


sConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("finalchaos.mdb")


Bostjan

bostjank
01-18-2003, 11:38 AM
You may also check out this page - it deals with db errors
http://www.aspfaq.com/2009

Bostjan

The69Pimp
01-18-2003, 11:42 AM
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, 11:56 AM
You forgot


MyConn.open sConn


Bostjan

The69Pimp
01-18-2003, 11:58 AM
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, 02:29 PM
Two questions:
Does your ISP support MS Access?
Is your MDB file valid Access file?

Bostjan

The69Pimp
01-18-2003, 02: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, 05:34 PM
If it woked I'd bet there is something wrong on the server of your ISP.

Bostjan

aCcodeMonkey
01-20-2003, 07: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:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum