access db via asp.net

S

segue

I'd greatly appreciate suggestions on a better method for cursing through
access database tables or why I'm getting the following error at
oleConnection.Open().

Do I need an odbc syntax instead of oledb?
Much thanks.

System.Data.OleDb.OleDbException: The database has been placed in a state on
machine 'IO' that prevents it from being opened or locked.

Dim olestring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\db\db2000_1_client.mdb"
Dim qstring As String = "SELECT * FROM " & aTable & ""

Try

oleConnection = New OleDbConnection(olestring)
'oleDataAdapter = New oledataadapter
oleConnection.Open()
 
M

Manish

Try to give ASPNET account rights to the folder which contains the mdb
database and make sure that database is not opened/used by some other
Application.

Regards,
Manish
www.ComponentOne.com
 
M

Michael Nemtsev [MVP]

Hello segue,

Are u sure that u are using the right connection string? U can check it there
http://connectionstrings.com/

I recommend u to use the following OLEDB sample how to work with Access DB
in C# http://msdn2.microsoft.com/en-us/library/aa288452(VS.71).aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


s> I'd greatly appreciate suggestions on a better method for cursing
s> through access database tables or why I'm getting the following error
s> at oleConnection.Open().
s>
s> Do I need an odbc syntax instead of oledb?
s> Much thanks.
s> System.Data.OleDb.OleDbException: The database has been placed in a
s> state on machine 'IO' that prevents it from being opened or locked.
s>
s> Dim olestring As String =
s> "Provider=Microsoft.Jet.OLEDB.4.0;Data
s> Source=c:\db\db2000_1_client.mdb"
s> Dim qstring As String = "SELECT * FROM " & aTable & ""
s> Try
s>
s> oleConnection = New OleDbConnection(olestring)
s> 'oleDataAdapter = New oledataadapter
s> oleConnection.Open()
 
S

segue

Thank you for your responses.

I'm now getting the error:
System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot
find the input table or query 'Reports'. Make sure it exists and that its
name is spelled correctly.

From:

Dim olestring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\db\db2000_1_client.mdb;Persist Security Info=False;"
Dim qstring As String = "SELECT * FROM Reports" ' & pwTable & ""
 
S

segue

Please disregard I figured it out by making a database connection with
visual studio and using the wizards to create functional queries.

Thanks.

segue said:
Thank you for your responses.

I'm now getting the error:
System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot
find the input table or query 'Reports'. Make sure it exists and that its
name is spelled correctly.

From:

Dim olestring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\db\db2000_1_client.mdb;Persist Security Info=False;"
Dim qstring As String = "SELECT * FROM Reports" ' & pwTable & ""

Michael Nemtsev said:
Hello segue,

Are u sure that u are using the right connection string? U can check it there
http://connectionstrings.com/

I recommend u to use the following OLEDB sample how to work with Access DB
in C# http://msdn2.microsoft.com/en-us/library/aa288452(VS.71).aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


s> I'd greatly appreciate suggestions on a better method for cursing
s> through access database tables or why I'm getting the following error
s> at oleConnection.Open().
s>
s> Do I need an odbc syntax instead of oledb?
s> Much thanks.
s> System.Data.OleDb.OleDbException: The database has been placed in a
s> state on machine 'IO' that prevents it from being opened or locked.
s>
s> Dim olestring As String =
s> "Provider=Microsoft.Jet.OLEDB.4.0;Data
s> Source=c:\db\db2000_1_client.mdb"
s> Dim qstring As String = "SELECT * FROM " & aTable & ""
s> Try
s>
s> oleConnection = New OleDbConnection(olestring)
s> 'oleDataAdapter = New oledataadapter
s> oleConnection.Open()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top