Syntax error in FROM clause.
Here is the code I am running, and i have an active connection VSGSAMDB previously opened. so that is not an issue:
strSAMTotCntSql - declared before
Dim MDBInfoCMD As ADODB.Command
Dim lngInfoCnt As Integer
Set VGInfoTable = New ADODB.Recordset
Set MDBInfoCMD = New ADODB.Command
Set MDBInfoCMD.ActiveConnection = VSGSAMDB
MDBInfoCMD.CommandText = strSAMTotCntSql
strSAMTotCntSql = "SELECT Count([MDB Information].converted) AS Cnt FROM [MDB Information];"
VGInfoTable.Open strSAMTotCntSql, VSGSAMDB, adOpenKeyset, adLockOptimistic, adCmdTable
This query runs perfectly within database, yet I am getting an error message:
err.Description
Syntax error in FROM clause.
err.Number
-2147217900
Can anybody explain/help me on it?
|