I am trying to create and populate a DBF or MDB via ODBC and have been running into primarykey problems.
Is there any way around this problem with these types of odbc drivers?
Do I need to move to an SQL driver?
here is some of my code:
- Code: Select all Expand view
- #include "FiveWin.ch"
function Main()
local adsn
local xdsn
local oodbc
local oodbca
xdsn:="TESTDBF"
oodbc:=TOdbc():new(xdsn)
oOdbc:Create( "Test", { { "Name", "C", 50, 0,"NOT NULL PRIMARY KEY" },;
{ "phone", "C", 15, 0,"" },;
{ "age", "C", 3, 0,"" } } )
oodbca:=TdbOdbcDirect():new("SELECT * FROM TEST",oodbc)
oodbca:AddNew()
oodbca:Update()
oodbc:end()
return nil
Thanks