jonathanfrascella
Programmer
I've got a standalone Access DB (with Forms, code, etc) that I need to create an ASP frontend for.
The problem is that the existing Tables, Fields and Queries don't have very forgiving names, with spaces used throughout. I've also encountered problems with SQL that doesn't seem to be standard, or it possibly could be an incompatibility between the SQL and JET Drivers I'm connecting with through my ASP application.
Example names:
Tables - H&S_Accidents_Data and H&S_Accidents_Data_Master
Query - Create H&S Accidents Data
The SQL inside the above query is:
SELECT [H&S_Accidents_Data_Master].* INTO [H&S_Accidents_Data]
FROM [H&S_Accidents_Data_Master];
In an ideal world, I would re-write the Query so it performs an INSERT of a SELECT results set, but I don't want to touch the code of Queries or change the table schema.
When (trying) to run the Query in my ASP code I get the following error:
Microsoft JET Database Engine error '80040e14'
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
I've also got another Query that runs something along the lines of:
SELECT * FROM Reports WHERE ReportTitle LIKE "ACC*"
The query itself runs fine in Access, but ASP doesn't like the asterisk on the LIKE term, but when I change it to a "%" symbol, the ASP works and the Access returns no results.
My ASP code is as follows:
'(DB connections and paths already declared and opened successfully)
Set oCmd = server.CreateObject("ADODB.Command"
sSQL = "[Create H&S Accidents Data]"
oCmd.ActiveConnection = oConn
oCmd.CommandText = sSQL
oCmd.execute
Basically I'm just after some pointers as to whether my SQL code is the problem (in which case I've got a problem) or I need to use different drivers to open the DB through ASP.
Any help would be greatly appreciated.
The problem is that the existing Tables, Fields and Queries don't have very forgiving names, with spaces used throughout. I've also encountered problems with SQL that doesn't seem to be standard, or it possibly could be an incompatibility between the SQL and JET Drivers I'm connecting with through my ASP application.
Example names:
Tables - H&S_Accidents_Data and H&S_Accidents_Data_Master
Query - Create H&S Accidents Data
The SQL inside the above query is:
SELECT [H&S_Accidents_Data_Master].* INTO [H&S_Accidents_Data]
FROM [H&S_Accidents_Data_Master];
In an ideal world, I would re-write the Query so it performs an INSERT of a SELECT results set, but I don't want to touch the code of Queries or change the table schema.
When (trying) to run the Query in my ASP code I get the following error:
Microsoft JET Database Engine error '80040e14'
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
I've also got another Query that runs something along the lines of:
SELECT * FROM Reports WHERE ReportTitle LIKE "ACC*"
The query itself runs fine in Access, but ASP doesn't like the asterisk on the LIKE term, but when I change it to a "%" symbol, the ASP works and the Access returns no results.
My ASP code is as follows:
'(DB connections and paths already declared and opened successfully)
Set oCmd = server.CreateObject("ADODB.Command"
sSQL = "[Create H&S Accidents Data]"
oCmd.ActiveConnection = oConn
oCmd.CommandText = sSQL
oCmd.execute
Basically I'm just after some pointers as to whether my SQL code is the problem (in which case I've got a problem) or I need to use different drivers to open the DB through ASP.
Any help would be greatly appreciated.