error on from clause where not

  • Thread starter Thread starter Douglas J. Steele
  • Start date Start date
D

Douglas J. Steele

That looks like .Net code: I think you'll stand a better chance of getting
an answer if you ask in a .Net group.
 
1) When you make assignments to objects, you need to use Set:

Set cmd = New OleDb.OleDbCommand(sql, con)

Set rs = cmd.ExecuteReader()

2) The code you provided doesn't indicate that you have Set con to anything,
which I suspect would also cause problems.

HTH,
 
Hello,
I am using access db,

I got the following error
System.Data.OleDb.OleDbException: Syntax error in FROM clause ...

even the sql code is ok.
(I ran the sql directly in access)

dim sql as string
Dim cmd As OleDb.OleDbCommand

Dim rs As OleDb.OleDbDataReader

Dim con as oledb.OleDbConnection

.....

sql = "select ... "
cmd = New OleDb.OleDbCommand(sql, con)


rs = cmd.ExecuteReader() / I got the error just after this line.



What's wrong ?

Thanks :)
 
Found.
The table is called user.
For some reason, on .net application this name is wrong.
When I run the sql statment on access environment - it is OK.

And , besides, on which newsgroup (for access & .net) - I didn't find any ?

Thanks :)
 
1) When you make assignments to objects, you need to use Set:
.....
That's why I did, and I don't think this has to cause a kind of problem.

At Microsoft Visual studio .NET 2003,
when I put set rs = new ... at my code, the IDE automatically eliminates
the word "set",
so I get automatically code with no "set rs = new ... " , but just "rs = new
...."

Thanks :)
 
John M said:
....
That's why I did, and I don't think this has to cause a kind of problem.

At Microsoft Visual studio .NET 2003,
when I put set rs = new ... at my code, the IDE automatically eliminates
the word "set",
so I get automatically code with no "set rs = new ... " , but just "rs =
new ..."

..Net doesn't use the Set keyword.

Coding questions related to .Net are better asked in newsgroups related to
..Net. They start microsoft.public.dotnet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top