MS OLE DB Provider won't work with boolean

MS OLE DB Provider won't work with boolean

Post by Bill Campbel » Fri, 14 Jan 2000 04:00:00



VS 6.0, NT 4.0 Server

When using the Microsoft OLE DB Provider for Microsoft Jet there is a
problem in
" select * from address where current = -1 " . The current field is a
adBoolean type. However, when using the ODBC Microsoft Access Driver, it
works perfectly. I need to use the MS OLE DB Provider for MS Jet. What
is the problem and  should I use integer instead of boolean? I wanted to
stick with the boolean, if possible.

The following error is received when the below code is executed:
Run-time error '-2147467259(80004005)
Method 'Execute' of object'_Command' failed

[cut code]

    ' Establish a connection
    With conn
         ''''  '.Open "PROVIDER=MSDASQL;dsn=new;uid=;pwd=;"
''       '''' .Provider = "MSDASQL"
''      ''''  .ConnectionString = "Data Source=new"
''      '''' .Open
          .Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=tcssDb.mdb"
    End With

    ' Create a Command object
    'sSQL = "select * from address where entityType = '" & ENTITYTYPEcm
& "' and entityID  = " & IDcm & " current = 'TRUE'"
    With com
        .ActiveConnection = conn
        .CommandText = "SELECT * FROM address where current = -1"
''''' current is boolean type in Jet 4.0 db
    End With

[cut code]

Any help is greatly appreciated.

Bill

 
 
 

MS OLE DB Provider won't work with boolean

Post by Bill Campbel » Fri, 14 Jan 2000 04:00:00


VS 6.0, NT 4.0 Server

When using the Microsoft OLE DB Provider for Microsoft Jet there is a
problem in
" select * from address where current = -1 " . The current field is a
adBoolean type. However, when using the ODBC Microsoft Access Driver, it
works perfectly. I need to use the MS OLE DB Provider for MS Jet. What
is the problem and  should I use integer instead of boolean? I wanted to
stick with the boolean, if possible.

The following error is received when the below code is executed:
Run-time error '-2147467259(80004005)
Method 'Execute' of object'_Command' failed

[cut code]

    ' Establish a connection
    With conn
         ''''  '.Open "PROVIDER=MSDASQL;dsn=new;uid=;pwd=;"
''       '''' .Provider = "MSDASQL"
''      ''''  .ConnectionString = "Data Source=new"
''      '''' .Open
          .Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=tcssDb.mdb"
    End With

    ' Create a Command object
    'sSQL = "select * from address where entityType = '" & ENTITYTYPEcm
& "' and entityID  = " & IDcm & " current = 'TRUE'"
    With com
        .ActiveConnection = conn
        .CommandText = "SELECT * FROM address where current = -1"
''''' current is boolean type in Jet 4.0 db
    End With

[cut code]

Any help is greatly appreciated.

Bill

 
 
 

MS OLE DB Provider won't work with boolean

Post by Bill Campbel » Fri, 14 Jan 2000 04:00:00


VS 6.0, NT 4.0 Server

When using the Microsoft OLE DB Provider for Microsoft Jet there is a
problem in
" select * from address where current = -1 " . The current field is a
adBoolean type. However, when using the ODBC Microsoft Access Driver, it
works perfectly. I need to use the MS OLE DB Provider for MS Jet. What
is the problem and  should I use integer instead of boolean? I wanted to
stick with the boolean, if possible.

The following error is received when the below code is executed:
Run-time error '-2147467259(80004005)
Method 'Execute' of object'_Command' failed

[cut code]

    ' Establish a connection
    With conn
         ''''  '.Open "PROVIDER=MSDASQL;dsn=new;uid=;pwd=;"
''       '''' .Provider = "MSDASQL"
''      ''''  .ConnectionString = "Data Source=new"
''      '''' .Open
          .Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data
Source=tcssDb.mdb"
    End With

    ' Create a Command object
    'sSQL = "select * from address where entityType = '" & ENTITYTYPEcm
& "' and entityID  = " & IDcm & " current = 'TRUE'"
    With com
        .ActiveConnection = conn
        .CommandText = "SELECT * FROM address where current = -1"
''''' current is boolean type in Jet 4.0 db
    End With

[cut code]

Any help is greatly appreciated.

Bill

 
 
 

MS OLE DB Provider won't work with boolean

Post by Bill Campbel » Fri, 14 Jan 2000 04:00:00


I figured it out. MS OLEDB Provider for MS Jet doesn't like the word
'current' for some unknown reason. I merely changed the name and it works
the same as the ODBC Microsoft Access Driver without the name change. I'll
just add that little bit of information to my list of Things To Do Before
Posting To The Newsgroups.

BTW, how do you find out what a run time error number means? That would have
been helpful.

Bill

 
 
 

MS OLE DB Provider won't work with boolean

Post by Jeff Koh » Sat, 15 Jan 2000 04:00:00


A good guideline is to avoid using table/fieldnames that could also be
interpreted as keywords. Jet/DAO will let you get away with this by placing
the fieldname in brackets, but it's not really a good idea and if you change
to another database later (such as MSSQL) you'll have problems.

Jeff


Quote:> I figured it out. MS OLEDB Provider for MS Jet doesn't like the word
> 'current' for some unknown reason. I merely changed the name and it works
> the same as the ODBC Microsoft Access Driver without the name change. I'll
> just add that little bit of information to my list of Things To Do Before
> Posting To The Newsgroups.

> BTW, how do you find out what a run time error number means? That would
have
> been helpful.

> Bill