[AccessD] Jet version sql error Try 2

Doug Murphy dw-murphy at cox.net
Tue Sep 11 12:04:37 CDT 2007


Hi Gustav,

This is a runtime that I install from a test CD.  It runs correctly on
operating systems other than win 98 SE.  I know the table is populated since
I put the values in and that the recordset returns values, when it runs
correctly.

As I responded to Max on his post I suspect this is something to do with the
version of jet used on Windows 98 and later versions of windows.  My
installer checks the windows version and loads the apprpropriate version of
Jet 4 SP8.  I just can't figure out why this simple string would be
interpreted differently.

Doug 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, September 11, 2007 6:24 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Jet version sql error Try 2

Hi Doug

Strange, except that sSQL is never Null and dbOpenDynaset is the default
method for attached tables.
Try with another table/database to check if the table should be corrupt.

/gustav

>>> dw-murphy at cox.net 11-09-2007 06:13 >>>
 
OK I'll try again with a simpler (?) question.

Any one see a reason why the following sql string generates an error when
used to open a recordset?

"Select * From tblUserFormat Where fldCountry = 'United States';"

Generates an error 3075 when run in the following line:

"Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)"

The error message that gives the error number 3075 indicates that there is
some problem with fldCountry = 'United States'

I have modified the code slightly from my first post to use a dynaset type
recordset and added the semicolon at the end of the query string.  Same
error is generated with the updated code.  The complete procedure up to this
point is as follows.

Public Sub GetCountrySettings()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim sSQL As String
Dim sCountrySettings As String
Dim fld As Field
Dim LCID As Long

  LCID = 0  'GetSystemDefaultLCID()

   On Error GoTo GetCountrySettings_Error

      sCountrySettings = GetUserLocaleInfo(LCID, LOCALE_SCOUNTRY)
      tFM.sCountry = sCountrySettings
      
      If Not IsNull(sSQL) Then
            sSQL = "Select * From tblUserFormat Where fldCountry = '" &
sCountrySettings & "';"
            Set db = CurrentDb
            Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
            rs.MoveFirst

-- 


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list