Home > Software engineering >  VB database query problem.
VB database query problem.

Time:10-08

Access database has two table, table contains three fields is the same, now want to query the two tables at the same time, and all the other fields within the table content displayed, how to do? My code is:
 Adodc1. RecordSource="Select * From (Select * From table1 join table2 on table1. R1=table2. R1 and table1. The r2=table2. R2 and table1. The r3=table2. R3) Where r1='" & amp; Textqzl. Text & amp; "' and r2=" & amp; Textkd. Text & amp; "' and r3=" & amp; Textqsgd. Text & amp; "' 
"Adodc1. Refresh

Runtime has been prompt form words grammar errors, for advice, be obliged!

CodePudding user response:

Check when you are Posting under the first, the words "from" knock into "the form of words" wrong?

It must be pointed out that the SQL you write very formal, rough look, not in the middle of the second part "the select * from" space is clearly wrong, as for later not handle 'not to mention the,

Adodc1. RecordSource="Select * From (Select * From table1 join table2 on table1. R1=table2. R1 and table1. The r2=table2. R2 and table1. The r3=table2. R3) Where r1='" & amp; Textqzl. Text & amp; "' and r2=" & amp; Textkd. Text & amp; "' and r3=" & amp; Textqsgd. Text & amp; "'"
  • Related