April 7, 2011 at 1:52 pm
My code is below and terminates at the execution of the SQL query with this message:
The Microsoft Access database engine can not find the input table or query 'SELCT DISTINCT Usr FROM Main_Table'. Make sure it exists and its name is spelled correctly.
Public Sub WordCountByUser()
If IsNull(DLookup("[Name]", "[MSysObjects]", "[Type] IN (1, 4, 6) AND [Name] = '" & "WordCountByUser" & "'")) Then
CreateTable_WordCountByUser ("WordCountByUser")
Else
DoCmd.DeleteObject acTable, "WordCountByUser"
CreateTable_WordCountByUser ("WordCountByUser")
End If
Dim dbs As DAO.Database
Dim rstusr As DAO.Recordset2
Set dbs = CurrentDb
Set rstusr = dbs.OpenRecordset("SELCT DISTINCT Usr FROM Main_Table")
Dim x As Integer
x = 1
End Sub
April 7, 2011 at 2:09 pm
SELECT no SELCT. Lolll!!!!!!
April 28, 2011 at 10:12 am
Check you query syntax in your string "SELCT" >> "SELECT"
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
April 28, 2011 at 4:47 pm
Thanks. I have to be more careful of that stuff.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply