Posted on 2002-05-31
I have a DE named myDe and a Data Report page named myRpt. In my DE, i have a command named cmdTable which points directly to table named myTable. In myRpt page, for DataSource, i connect it to myDe, and for DataMember, i have it connect to cmdTable.
On one of the form, i have a textbox named myText and a button named btnSubmit. The function for the btnSubmit is:
Private Sub btnSubmit_Click()
myDe.rscmdTable.Open "SELECT * FROM myTable WHERE myID = '" & myText & "';"
When i execute this file, i got an error message:
"Run-time error '=2147217904 (80040e10)';
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1."
What is going on?
I also tried:
myDe.Commands("cmdTable").CommandText = "SELECT * FROM myTable WHERE myID = '" & myText & "';"
This gave me an error:
"Run-time error '-2147217900 (50040e14)';
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
What have i done wrong? Please help