Connecting to an Access-database

B

Bart Schelkens

Hi,

i have this website which connects to an Access-database.

I've made 2 local copies : 1 on a Win2000 and 1 on a Win XP.

When I start the site on my Win2000 I don't have any problem.
When I start the site on my Win XP I seem to have problems with my
connection to my database.

I've written a fucntion ExecuteSQLString to get a datareader from my
database .
Apparently when I get the error, it is on the line that says :
lconAdministration.Open.
At the time I get the error, I check my connectionstate and it says that is
closed.

Can anyone help me?
Thx

Public Function ExecuteSQLString(ByVal vstrQuery As String) As IDataReader

Dim lconAdministration As IDbConnection = GetConnection()

Try

Dim lcomInfo As IDbCommand = lconAdministration.CreateCommand

lcomInfo.CommandType = CommandType.Text

lcomInfo.CommandText = vstrQuery

lconAdministration.Open()

Return lcomInfo.ExecuteReader

lconAdministration.Close()

lconAdministration = Nothing

Catch ex As Exception

Throw

End Try

End Function
 
K

Ken Cox [Microsoft MVP]

Hi Bart,

Make sure the ASPNET account has modify permission in the directory where
the Access database is located. Access needs to create temporary files and
balks when the current "user" doesn't have sufficient rights to do so.

Ken
 
B

Bart Schelkens

Ken,

sometimes it works fine and when i click around on my site, it suddenly
gives me the error.
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top