|
 |
asp_web_howto thread: Access error
Message #1 by "Carlos Lamar" <lamar@s...> on Thu, 11 Jul 2002 14:33:01 -0700
|
|
Hello,
I am simply trying to connect to an Access database with the following
code:
----------
<%
' Create a Connection Object
Dim idbc
Set idbc =3D Server.CreateObject("ADODB.Connection")
' Generate a DSNLess connection string
Dim iconnString
iconnString =3D "DRIVER=3D{Microsoft Access Driver (*.mdb)};" & _
"DBQ=3D" & server.mappath("./fpdb/mydb.mdb") & ";"
' Open the connection
idbc.Open iconnString
%>
<%
Dim rPIN, RS, SQL
rPIN =3D Request.Form("PIN")
Set RS =3D Server.CreateObject("ADODB.Recordset")
SQL =3D "select * " _
& " from mydb " _
& " where PIN=3D'" & rPIN & "' "
RS.Open SQL, iconnString
%>
----------
The system is displaying the following message:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file already in use.
Any ideas as to what may be causing this? Thanks a million!
---Carlos
____________________________________________________
Carlos L. LaMar
Executive VP, IS & Management Development
snyder/newell, inc.
> *: xxx.xxx.xxxx
> *: xxx.xxx.xxxx (FAX)
> *: clamar@s...
> u http://www.snyder-newell.com/
>
>
>
Message #2 by "Drew, Ron" <RDrew@B...> on Thu, 11 Jul 2002 17:45:34 -0400
|
|
Check your mappath for the slashs and prefixes
<%
Dim idbc, mdbPath
set idbc =3D Server.CreateObject("ADODB.Connection")
mdbPath =3D Server.MapPath("..\fpdb\mydb.")
idbc.Open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _
"Data Source=3D" & mdbPath & ";" & _
"User Id=3Dadmin;" & _
"Password=3D;"
%>
-----Original Message-----
From: Carlos Lamar [mailto:lamar@s...]
Sent: Thursday, July 11, 2002 5:33 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Access error
Hello,
I am simply trying to connect to an Access database with the following
code:
----------
<%
' Create a Connection Object
Dim idbc
Set idbc =3D Server.CreateObject("ADODB.Connection")
' Generate a DSNLess connection string
Dim iconnString
iconnString =3D "DRIVER=3D{Microsoft Access Driver (*.mdb)};" & _
"DBQ=3D" & server.mappath("./fpdb/mydb.mdb") & ";"
' Open the connection
idbc.Open iconnString
%>
<%
Dim rPIN, RS, SQL
rPIN =3D Request.Form("PIN")
Set RS =3D Server.CreateObject("ADODB.Recordset")
SQL =3D "select * " _
& " from mydb " _
& " where PIN=3D'" & rPIN & "' "
RS.Open SQL, iconnString
%>
----------
The system is displaying the following message:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file already in use.
Any ideas as to what may be causing this? Thanks a million! ---Carlos
____________________________________________________
Carlos L. LaMar
Executive VP, IS & Management Development
snyder/newell, inc.
> *: xxx.xxx.xxxx
> *: xxx.xxx.xxxx (FAX)
> *: clamar@s...
> u http://www.snyder-newell.com/
>
>
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |