Forum Moderators: open

Message Too Old, No Replies

syntax error in from clause

syntax error in from clause

         

Gashach

2:49 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



I am trying to program a VB6 App to talk to an access Database. Here is the code i am using:

Set mainDB = New ADODB.Connection

mainDB.ConnectionString = "File Name=whline.udl;"
mainDB.Open

Set objComm = New ADODB.Command
objComm.ActiveConnection = mainDB
objComm.CommandType = adCmdTable
objComm.CommandText = "SELECT COUNT (*) FROM [Userlist] WHERE [Userlist]![isActive]=yes;"

Set objRec = New ADODB.Recordset
Set objRec.Source = objComm
objRec.Open

I am getting an error "syntax error in from clause" and i cannot understand why. I made sure every thing was in [] that needed to be and no keywords were used, but i still get the error.Any help would be appreciated.

hakre

3:48 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi Gashach, welcome to webmasterworld [webmasterworld.com].

simply remove the brackets around 'Userlist' in the from clause and try again. hope this helps. if not, remove the where clause for testing purposes.

Gashach

4:51 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



Actualy i figgured out that the error was caused by the commandtype being table and not cmd