Connecting to an Access-database

  • Thread starter Thread starter Bart Schelkens
  • Start date Start date
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
 
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
 
Ken,

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