error on from clause where not

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.
 
G

George Nicholson

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,
 
J

John M

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 :)
 
J

John M

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 :)
 
J

John M

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 :)
 
D

Douglas J. Steele

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
 
Top