No conection associated with this command

Smee

Well-Known Member
Licensed User
Longtime User
I am getting an error message and i cannot work out what is wrong with the code. the message i get is this
Reader.Value=Cmd.ExecuteReader
Error description
No conection associated with this command

The code is as follows

SQLConn.New1
SQLConn.Open("Data source = " & AppPath & "\WD Sales.sl3")

cmd.New1
Reader.New1
Cmd.CommandText= "SELECT Description,QtyInStock FROM [Products] WHERE Code ='" & ProdCode & "'"
Reader.Value=Cmd.ExecuteReader

I have used similar code before without errors. Can anyone shed light on this

thanks

UPDATE:
i FOUND THE ANSWER, I did not define the cmd.new1 properly
It should read
Cmd.New1 ("", SQLConn.Value)
 
Last edited:
Top