Home > Back-end >  This code will look not to come out, the what reason
This code will look not to come out, the what reason

Time:09-24

Everybody is good, I use the Delphi xe10 programming a management software, access database programming has been completed, to transform his MSSQL 2008, two date format to convert to query, this made it, but several related programming can use before is how to return a responsibility, I am using database control is adoconnectin and adoquery1,
 adoquery1. SQL. The clear; 
Adoquery1. SQL. The Add (' the SELECT LSXSD. Id, LSXSD. Kh, LSXSD. KHMC, LSXSD. XSRQ, CKXX. CKMC,, LSXSD. Czy, LSXSD. JBR FROM LSXSD INNER JOIN CKXX ON LSXSD. Ck=CKXX. Id where LSXSD. KHMC='" + combobox2. Text + "' "' + 'and XSRQ between' ' '+ s1 +"' "' + 'and' ' '+ s2 +"' ");
Adoquery1. Open;


This code will look not to come out, the reason

After I remove the link can be found out to
 adoquery1. SQL. The clear; 
Adoquery1. SQL. The Add (' SELECT id, kh, KHMC XSRQ, CKMC, czy, JBR FROM LSXSD where LSXSD. KHMC='" + combobox2. Text + "' "' + 'and XSRQ between' ' '+ s1 +"' "' + 'and' ' '+ s2 +"' ");
Adoquery1. Open;


So I have to the entire program to change, have what good way!

CodePudding user response:

Has nothing to do with the controls, the access itself to join the support of the connection is not very good, not too complex and barely used,
SQL statements are must change, to support both writing,

CodePudding user response:

reference 1st floor jjpweb response:
has nothing to do with the controls, the access itself to join the support of the connection is not very good, not too complex and barely used,
SQL statement is must change, to support both writing,


That will have to change all the query is?
Add or remove modify other can use the

Is there a better the other way!!!

CodePudding user response:

Set up a table, all the statements

CodePudding user response:

You should have a standard format to write SQL query statements, to see if I can make it adapt to ACCESS

ACCESS to a computer driver version (version) JET possible relationship, especially involving data type date

Now commonly used JET4.0, so conservative point is to prepare the two versions

CodePudding user response:

Also recently colleagues do before modify the software, also with the Access,
Access does not support the INNER JOIN, you can only have Left the JOIN, JOIN, or Right
Or you directly SELECT * FROM A AS A, B AS B WHERE B.I D=Anderson, D

CodePudding user response:

Personal advice time type the most useful way to query parameters, using less between statements
  • Related