Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

[RESOLVED] DAO syntax error

$
0
0
I don't know if this question is about database, VB6 or installer (InstallAware 15) but here goes.

Does anyone have a suggestion about why this code runs in the IDE on the dev computer but fails on others after installation?

The SQL looks okay to me but maybe I'm not seeing something. I'm thinking that maybe I've left something out of the installation package. Jet40.msm & dao360.msm are included.

In the VB6 IDE at runtime, the SQL looks like this and it executes correctly:

Select Count(*) From ComputerPrefs Where ComputerName='TEST-XP';

This is what happens at runtime on a test machine.

Error msg: Syntax error in string in query expression 'ComputerName='TEST-XP'.


This is equivalent to the code that runs in the IDE but fails on a clean computer:
-------------------
Dim rs As DAO.Recordset
Dim szSQL As String
Dim szComputerName As String

szComputerName = "TEST-XP"
szSQL = "Select Count(*) From ComputerPrefs Where ComputerName='" & szComputerName & "';"

Set rs = g_oDB.OpenRecordset(szSQL, dbOpenForwardOnly)
-------------------

Thanks for any ideas.

Viewing all articles
Browse latest Browse all 2918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>