Home > Back-end >  Used to export to DBF query problem
Used to export to DBF query problem

Time:10-27

Path:=extractfilepath (application. ExeName) + 'SQL. Ini';
GetPrivateProfileString (' used ', 'DataSource', 'NIL' DataSource, 255, PChar (path));
GetPrivateProfileString (' used ', 'InitialCatalog', 'NIL' InitialCatalog, 255, PChar (path));
GetPrivateProfileString (' used ', the 'UserID', 'NIL' UserID, 255, PChar (path));
GetPrivateProfileString (' used to 'and' Password ', 'NIL' Password, 255, PChar (path));
GetPrivateProfileString (' used ', 'Source', 'NIL' Source, 255, PChar (path));

AdoCnn1. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source='+ + Source; Extended Properties=dBase 5.0 ';
CnnStr:='select * into aaa20121229001002. DBF';
CnnStr:=CnnStr + 'from hiszy_wtbfour';
CnnStr:=CnnStr + '[ODBC] [ODBC; IN;
CnnStr:=CnnStr + 'Driver=SQL Server; ';
CnnStr:=CnnStr + 'UID=' + UserID + '; The PWD='+ Password +'; ';
CnnStr:=CnnStr + + DataSource 'Server=' + '; The DataBase='+ InitialCatalog +'] ';
CnnStr:=CnnStr + 'where CYRQ & gt;='+' "' + DateTimeToStr (DT1. Datetime) + '"' + 'and CYRQ & lt;='+' "' + DateTimeToStr (DT2. Datetime) + '"';

AdoCnn1. Execute (CnnStr);

Problem a: standard expression data type mismatch
Problem two: save the aaa20121229001002. DBF, save be intercepted into aaa2012. DBF, don't know what reason
  • Related