Been working on methods for building a SQL string and then send it to a dataconnection set up for an Access db. Lots of little problems have started to develop and now the road is become very murky…hope the Lounge can spread a little light!
1) Standard connection Code can’t find the db where it’s supposed to be. Here’s the code:
‘– Declare your variables
Dim DBFileName
‘ Change the db1.mdb to .mdb
DBFileName = “CRCGIntegratedStaffingForms.mdb”
‘– Create dataconnection and recordset object and open database
Set DataConnection = Server.CreateObject(“ADODB.Connection”)
Set myRecordSet = Server.CreateObject(“ADODB.Recordset”)
DataConnection.Open = “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=” & Server.MapPath(“”) & “MDBCRCGIntegratedStaffingForms.mdb;”
I’ve used this sort of code for establishing a connect to an access db in my web server in a folder called ‘MDB’. I have other pages that open and read records and there’s no problem finding the db. However, now I get this strange message:
cannot find the file ‘C:WINNTsystem32CRCGIntegratedStaffingForms.mdb’.
I decided to move it there just to satisfy whatever demon is not looking in the right spot and get access denied errors such as
The Microsoft Jet database engine cannot open the file ‘C:WINNTsystem32CRCGIntegratedStaffingForms.mdb’. It is already opened exclusively by another user, or you need permission to view its data.
I also have a strange problem with some Select Case statements in asp that work perfectly well in one page but not on another, but I’d like to know first of all why asp can’t seem to look in the right folder. I *did* setup the folder in IIS to enable scripting and have the following in the header for the asp page:
Also, I don’t know if it is best to use INSERT or UPDATE for adding info to a file, as I’ve never done this before.
Any ideas?
TIA, as ever.