Home > database >  Urgent, urgent to hurry for urgent problems DBF table for PB operation
Urgent, urgent to hurry for urgent problems DBF table for PB operation

Time:09-17

VFP can use select * from table 1 into the table table 2 create a same as table 1 table 2

Now PB DBF directory via the ODBC connection, also want to use the grammar to create a table above 2

ODBC_FOX=Create transaction
ODBC_FOX. DBMS="ODBC"
ODBC_FOX. The AutoCommit=False
ODBC_FOX. DBParm=gs_dbparm_fox

Disconnect the Using ODBC_FOX;
Connect Using ODBC_FOX;
If ODBC_FOX. Sqlcode=1 Then
MessageBox (" message ", "unable to connect to the database! Error message: ~ r "+ ODBC_FOX sqlerrtext, StopSign!)
The Return - 1
End the If

String ls_sql, ls_err

Ls_sql="select * from bb into table aa"
ODBC_FOX. The AutoCommit=TRUE
The EXECUTE IMMEDIATE: ls_sql Using ODBC_FOX;
If ODBC_FOX. Sqlcode<0 Then
Ls_err=string (ODBC_FOX Sqlcode) + ";" + ODBC_FOX. Sqlerrtext
Messagebox (' error message ', "an error occurred when the delete! ~ n "+ ls_err, stopsign!)
The Return - 1
End the If
Commit the using ODBC_FOX;
ODBC_FOX. The AutoCommit=False

To create is not successful, which ace to give directions, thank you very much

CodePudding user response:

String ls_sql, ls_err

Ls_sql="select * from bb into table aa"
ODBC_FOX. The AutoCommit=TRUE
The EXECUTE IMMEDIATE: ls_sql Using ODBC_FOX;
If ODBC_FOX. Sqlcode<0 Then
Ls_err=string (ODBC_FOX Sqlcode) + ";" + ODBC_FOX. Sqlerrtext
Messagebox (' error message ', "an error occurred when the delete! ~ n "+ ls_err, stopsign!)
The Return - 1
End the If
Commit the using ODBC_FOX;
ODBC_FOX. The AutoCommit=False

This in which database will not be successful execution

CodePudding user response:

Select * from bb into table aa

Should be

Insert into aa the select * from bb