Another Migration Question - DELETE SQL Statement

E

Eric

I have a Delete query that clears some temp tables -

The SQL:
DELETE tempGroup.* FROM tempGroup;

The code:
Set QryDef = DB.QueryDefs("qryTempSowGroupDelete")
QryDef.Execute (dbSeeChanges)


I get the following Error:
3146 ODBC Call Failed.

I know there are probably better ways of doing this, but I'd like to make
the existing code work, with a minimum of modifications. . .

I added a unique index to the involved tables, before upsizing.

Thanks

e
 
J

Joe Fallon

Not very clear what you are doing.
It looks like you might be using Access dialect SQL for SQL Server tables.
If so, you need to modify the SQL command to be the right dialect.

e.g.
Access: DELETE tempGroup.* FROM tempGroup;
SQL Server: DELETE FROM tempGroup

Note the lack of a * in SQL Server command.
 
E

Eric

Not very clear what you are doing.

I have an access database separated into a data.mdb and app.mdb, with a vb6
front end. I am moving the data.mdb to SQL Server, as I am going to start
writing .Net apps (Handhelds, etc).

I would like to modify the VB6 app as little as possible. Currently, the
delete query is in access (app.mdb) and tries to delete data from the
attached SQL table. . . however, I get the 3146 error.

I assume that I can run the query, as it works fine from access, if I change
one of the options or syntax (I needed to add dbseechanges in other places).

Alternativly, I could pass the SQL directly to SQL Server? Not sure how.

Thanks for any help.

e
 

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

Top