PDA

Click to See Complete Forum and Search --> : syntax error


artsapimp
Aug 19th, 2000, 02:26 PM
Microsoft JET Database Engine error '80040e14'

Syntax error in FROM clause.

/arthur/new1/observations/new.asp, line 16


Dim cnn
Dim rst
Dim ConnectString
Dim strSQL

Set cnn = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")

ConnectString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\shared webs\art\new1\password\db\password.mdb"

cnn.Open ConnectString

strSQL = "Select * from password"

rst.Open strSQL, cnn

Aug 19th, 2000, 10:47 PM
this is my first shot on answering a question on SQl, so bare with me,
but dont you need a semicolon at the end of the SQL statement??

or maybe the tablename and database name need to be different??

artsapimp
Aug 20th, 2000, 09:39 AM
I went to http://www.microsoft.com and searched for the error message and it gave me the answer. It might help someone here so I'll explain what I had to do.

The error means I'm using a word for the table which is considered a "special" word (or something like that). I had to either change the name of the table or put [] around it in the sql statement.

The final strSQL looked like this and it worked...


strSQL = "SELECT * FROM [password]"