Home > database >  Questions about PB connection Foxpro DBF file.
Questions about PB connection Foxpro DBF file.

Time:10-04

Questions about PB connection Foxpro DBF file.
Encountered in the work need to write data to the Foxpro 3.0 DBF file, try the following ways but can't achieve.
1. The use of ODBC Driver "do Microsoft dBase (*. DBF)" Driver to create the ODBC data source, the data source only chose the path, the other using the default options.
Using the ODBC in PB created a DW, the column type numeric in DW is shown as' numeric types. To insert records in the DW (data not wrong) after the update failure. Use saveas () into a DBF file successful dBaseIII. But use EXCEL to open the DBF file, found that the cell format of the data type field was "custom", is set to the value, and set up a small digital, can show the decimal, or a small digital display, to introduce this file in kingdee K3, the decimal places will be ignored, and the use of EXCEL opened the FOXPRO 3 DBF, numerical value is normal, according to a small digital display also normal, then open the DW saveas () dBaseIII DBF small digital display is not normal, can be thought of as the dBaseIII DBF the FOXPRO 3 DBF,
2, the use of ODBC Driver "para o Microsoft Visual FoxPro" Driver to create the ODBC data source, the data source only chose the path, other options using the default.
Using the ODBC in PB created a DW, this DW column type in the numeric display, such as' n (20, 5) type. To insert records in the DW (data not wrong) after the update failure. Use saveas () into dBaseIII DBF file has failed!
3, under the PB environment database of panel used in the operation of the ODBC connection phenomenon,

Now think excuse me, how can we make the PB generate qualified Foxpro 3 DBF files?


CodePudding user response:

//the following is a database connection VF and reading data, the original poster can try to change, the premise is to must have corresponding DBF file exists

String ls_foxpath
Long ll_pos=1

Ls_foxpath=GetCurrentDirectory ()
Ll_pos=Pos (ls_foxpath, "", ll_pos)
The do while ll_pos & gt; 0
Ls_foxpath=Left (ls_foxpath ll_pos) + "" + Mid (ls_foxpath, ll_pos + 1)
Ll_pos=Pos (ls_foxpath, "", ll_pos + 2)
Loop

Long ll_rtn
Ll_rtn=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ ODBC Data Sources ", "bianh - id - import", RegString! , "Microsoft Visual FoxPro Driver")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import "and" Driver ", RegString! , "C: \ \ WINNT \ \ System32 \ \ vfpodbc DLL")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "SourceDB", RegString! , ls_foxpath)
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "Description", RegString! , "")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "SourceType", RegString! , "DBF")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "BackgroundFetch", RegString! , "Yes")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "Exclusive", RegString! , "No")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "Null", RegString! , "Yes")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "does", RegString! , "Yes")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "Collate RegString! , "the Machine")
Ll_rtn +=RegistrySet (" HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC \ ODBC.ini \ bianh - id - import ", "SetNoCountOn", RegString! , "No")
If ll_rtn & lt;> 11 then
MessageBox (" Caption ", "set the system environment when making mistakes! The system will exit ", StopSign!)
The halt
End the if

The transaction sql_fox

Sql_fox=create transaction
Sql_fox. DBMS="ODBC"
Sql_fox. The AutoCommit=False
Sql_fox. DBParm="ConnectString='DSN=bianh - id - import; UID=; The PWD='
"Connect using sql_fox;
If sql_fox. Sqlcode=1 then
MessageBox (" message ", "unable to connect to the database! Error message: ~ r "+ sql_fox sqlerrtext, StopSign!)
The halt
End the if

CodePudding user response:

Now I will use the "Microsoft Visual FoxPro Driver" drive to build an ODBC connection, try to see if there is any effect.

CodePudding user response:

Test a, the use of "Microsoft Visual FoxPro Driver" to build an ODBC connection, and then use this link to do a DW, but DW UPDATE ()=1, there is no error message,

CodePudding user response:

Have a primary key?

CodePudding user response:

Must be set up to update the list

CodePudding user response:

Chose to update all the columns, and select a few key! Set up to update the table name,

CodePudding user response:

up

CodePudding user response:

Later don't send duplicate posts

CodePudding user response:

I think different version will be different, not later.
Consult.

CodePudding user response:

Please refer to:

http://community.csdn.net/Expert/topic/5484/5484230.xml

CodePudding user response:

It is other reason, is OK. Thank you!

CodePudding user response:

I don't know, to help
  • Related