473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Connecting to an Access-database

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
Nov 18 '05 #1
3 1403
The error I get is "Unspecified Error"

"Bart Schelkens" <bs********@hotmail.com> schreef in bericht
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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

"Bart Schelkens" <bs********@hotmail.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3
Ken,

sometimes it works fine and when i click around on my site, it suddenly
gives me the error.
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> schreef in bericht
news:%2***************@TK2MSFTNGP14.phx.gbl...
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

"Bart Schelkens" <bs********@hotmail.com> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JA | last post by:
Hi, I am total newbie to SQL Server. My new host tells me I can connect through AccessXP or 2002. I have Access 2000. Can I not connect with that also? Thanks, JA
2
by: bart van deun | last post by:
Hi everybody, Can someone tell me what are the possibilities for connecting Access to the web? Something like thirt party software to do that? Thank you, Someone from Belgium - Europe
1
by: Giel Overhof | last post by:
I am searching for code that makes it possible to connect a cash register (operated with microsoft Access 2003 software) with a PIN/CHIP payment divise. Can some of you give me futher information...
1
by: SqlJunkies User | last post by:
Hi I try to call a Webservice via java, the webservice is loacated on a IIS-server(Dot-net). It is a trusted Domain so I do not have to Connect with a Username and Password. It seems to be a...
4
by: kthiagar | last post by:
Hi I am trying to connect to a password protected access file from VB.NET. I have no problem in connecting to Access, if I remove the password. This is what I am doing: In the server explorer,...
3
by: Chris | last post by:
Don't know if there is a simple solution for this one or not. When running SQL server on a machine with 2000 loaded and the complete SQL package I don't have any issues. Now I'm trying to login...
1
by: jobs | last post by:
I am able to access 9i and 10g Oracle DBs from other clients on my pc - sqlplus, PLSQL Developer, etc. As a simple test I just wanted to connect and access the same oracle DBs through ASP.NET on...
1
by: mousse122 | last post by:
I am trying to convert MS Access 2003 databases (*.mdb) to MS Access Projects (*.adp) and connecting to the new SQL table. Can anyone help me understand how to migrate the forms into the *adp? This...
3
by: BigZero | last post by:
hello i m new to php i m working on project that has interface with simple html and php i m thinking to use i got some problem with the connecting to DB here is the code for connecting db ...
0
by: fatimang | last post by:
can someone give me codes or things to use on connecting Python to MS Access. thank you in advance.. GOD BLESS..
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.