|
 |
asp_databases thread: 8004005 Error HELP!
Message #1 by jfoust@N... on Mon, 23 Oct 2000 17:11:41 +0100
|
|
I'm a total newbie to this, and I'm trying to put a database on my
company's server into a page that lets you see all of the entries. I was
given the path by our network guy, and I'm trying to do this without a DSN
string. Here's the code I use:
set oConn=Server.CreateObject("ADODB.connection")
set ors=Server.CreateObject("ADODB.recordset")
strSource = "DRIVER={Microsoft Access Driver (*.mdb) }"
strSource = strSource & "; DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
oConn.ConnectionString = strSource
oConn.Open
but when I run the page, I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
/test_josh/globe.asp, line 17
Line 17 is oConn.Open
I'm at a loss - I can't find any problems with the code - the only thing I
can think of is that I'm improperly calling something (like a file path,
or something along those lines). If anyone can help me it would be
greatly appreciated. Thanks.
-Josh
Message #2 by Andy Johnson <lysaer@d...> on Mon, 23 Oct 2000 11:40:38 -0500
|
|
This is the connect string that I use in my pages for a DSN-less Access
connection: (I swapped my path for yours)
ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
Couple of things I ran into...check and make sure that's the correct
path entry. My path runs along the lines of d:\www\domainname\www etc.
Try using just c:\test_josh\globewave.mdb, because your IIS may be
bogging down on the root path.
jfoust@N... wrote:
>
> I'm a total newbie to this, and I'm trying to put a database on my
> company's server into a page that lets you see all of the entries. I was
> given the path by our network guy, and I'm trying to do this without a DSN
> string. Here's the code I use:
>
> set oConn=Server.CreateObject("ADODB.connection")
> set ors=Server.CreateObject("ADODB.recordset")
> strSource = "DRIVER={Microsoft Access Driver (*.mdb) }"
> strSource = strSource & "; DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
> oConn.ConnectionString = strSource
> oConn.Open
>
> but when I run the page, I get this error:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
> [Microsoft][ODBC Driver Manager] Data source name not found and no default
> driver specified
>
> /test_josh/globe.asp, line 17
>
> Line 17 is oConn.Open
>
> I'm at a loss - I can't find any problems with the code - the only thing I
> can think of is that I'm improperly calling something (like a file path,
> or something along those lines). If anyone can help me it would be
> greatly appreciated. Thanks.
>
> -Josh
>
Message #3 by "Leo" <leo@i...> on Mon, 23 Oct 2000 12:53:45 -0400
|
|
Try this one without using the DSN:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
objConn.Open
Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = objConn
Set objRS = Server.CreateObject("ADODB.recordset")
objRS.Open sqltext, objConn
Leo
-----Original Message-----
From: jfoust@N... [mailto:jfoust@N...]
Sent: Monday, October 23, 2000 12:12 PM
To: ASP Databases
Subject: [asp_databases] 8004005 Error HELP!
I'm a total newbie to this, and I'm trying to put a database on my
company's server into a page that lets you see all of the entries. I was
given the path by our network guy, and I'm trying to do this without a DSN
string. Here's the code I use:
set oConn=Server.CreateObject("ADODB.connection")
set ors=Server.CreateObject("ADODB.recordset")
strSource = "DRIVER={Microsoft Access Driver (*.mdb) }"
strSource = strSource & "; DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
oConn.ConnectionString = strSource
oConn.Open
but when I run the page, I get this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
/test_josh/globe.asp, line 17
Line 17 is oConn.Open
I'm at a loss - I can't find any problems with the code - the only thing I
can think of is that I'm improperly calling something (like a file path,
or something along those lines). If anyone can help me it would be
greatly appreciated. Thanks.
-Josh
Message #4 by Nisha Nambiar <nishanam@y...> on Mon, 23 Oct 2000 10:05:23 -0700 (PDT)
|
|
Josh
I am not sure if this will work but just try it,
sometimes swaping things would just work.
strSource = "DRIVER={Microsoft Access Driver (*.mdb);
DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
oConn.ConnectionString = strSource
oConn.Open
OR directly asign it
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb);
DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
Nisha
--- jfoust@N... wrote:
> I'm a total newbie to this, and I'm trying to put a
> database on my
> company's server into a page that lets you see all
> of the entries. I was
> given the path by our network guy, and I'm trying to
> do this without a DSN
> string. Here's the code I use:
>
> set oConn=Server.CreateObject("ADODB.connection")
> set ors=Server.CreateObject("ADODB.recordset")
> strSource = "DRIVER={Microsoft Access Driver (*.mdb)
> }"
> strSource = strSource & ";
> DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
> oConn.ConnectionString = strSource
> oConn.Open
>
> but when I run the page, I get this error:
>
> Microsoft OLE DB Provider for ODBC Drivers error
> '80004005'
>
> [Microsoft][ODBC Driver Manager] Data source name
> not found and no default
> driver specified
>
> /test_josh/globe.asp, line 17
>
> Line 17 is oConn.Open
>
> I'm at a loss - I can't find any problems with the
> code - the only thing I
> can think of is that I'm improperly calling
> something (like a file path,
> or something along those lines). If anyone can help
> me it would be
> greatly appreciated. Thanks.
>
> -Josh
>
Message #5 by "Foust, Joshua R." <jfoust@N...> on Mon, 23 Oct 2000 14:08:10 -0400
|
|
thank you very much - it works perfectly!!!
> -----Original Message-----
> From: Leo [SMTP:leo@i...]
> Sent: Monday, October 23, 2000 12:54 PM
> To: ASP Databases
> Subject: [asp_databases] RE: 8004005 Error HELP!
>
> Try this one without using the DSN:
>
> Set objConn = Server.CreateObject("ADODB.Connection")
> objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
> objConn.Open
> Set objCmd = Server.CreateObject("ADODB.Command")
> Set objCmd.ActiveConnection = objConn
> Set objRS = Server.CreateObject("ADODB.recordset")
> objRS.Open sqltext, objConn
>
> Leo
>
> -----Original Message-----
> From: jfoust@N... [mailto:jfoust@N...]
> Sent: Monday, October 23, 2000 12:12 PM
> To: ASP Databases
> Subject: [asp_databases] 8004005 Error HELP!
>
>
> I'm a total newbie to this, and I'm trying to put a database on my
> company's server into a page that lets you see all of the entries. I was
> given the path by our network guy, and I'm trying to do this without a DSN
> string. Here's the code I use:
>
> set oConn=Server.CreateObject("ADODB.connection")
> set ors=Server.CreateObject("ADODB.recordset")
> strSource = "DRIVER={Microsoft Access Driver (*.mdb) }"
> strSource = strSource & "; DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
> oConn.ConnectionString = strSource
> oConn.Open
>
> but when I run the page, I get this error:
>
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
> [Microsoft][ODBC Driver Manager] Data source name not found and no default
> driver specified
>
> /test_josh/globe.asp, line 17
>
> Line 17 is oConn.Open
>
> I'm at a loss - I can't find any problems with the code - the only thing I
> can think of is that I'm improperly calling something (like a file path,
> or something along those lines). If anyone can help me it would be
> greatly appreciated. Thanks.
>
> -Josh
>
Message #6 by "Ken Schaefer" <ken@a...> on Tue, 24 Oct 2000 11:27:47 +1000
|
|
> OR directly asign it
>
>
> oConn.Open "DRIVER={Microsoft Access Driver (*.mdb);
> DBQ=C:\Inetpub\wwwroot\test_josh\globewave.mdb"
No - never do this. If your database ever changes location, you'll have to
update all the lines of code that have this.
Always assign your connection string to a variable. Put that variable into
an include file, or make it an application variable.
That way, there's only a single line of code to change whenever you database
changes...
Cheers
Ken
|
|
 |