Nannanicha,
I finally wrote a (python) script that runs on the windows machine where the
VPF database tables are. The script access the database through a ODBC DSN
resource (defined in the windows machine).
The python script looks like the following:
-----------------------
import odbc
def cleanfield(s):
ss = str(s)
ss = ss.strip()
ss = ss.replace("&","&")
ss = ss.replace('"',""")
ss = ss.replace('<',"<")
ss = ss.replace('>',">")
return(ss)
try:
s = odbc.odbc('MyODBCDNS')
cur = s.cursor()
cur.execute("select field_1,field_2, field_3 from MyTABLE")
rec = cur.fetchall()
except:
print 'error reading ODBC'
try:
file = open("MyExportFileName.xml", "w")
file.write('<?xml version="1.0" encoding="ISO-8859-1"?>'+'\n')
file.write('<entity-engine-xml>'+'\n')
for i in rec:
file.write('<MyEntityName ')
file.write('field_1="'+cleanfield(i[0])+'" ')
file.write('field_2="'+cleanfield(i[1])+'" ')
file.write('field_3="'+cleanfield(i[2])+'" ')
file.write('/>\n')
file.write('</entity-engine-xml>'+'\n')
file.close()
except:
print 'error writing'
------------------------------------------------------------------
Since it seems that VFP is not suitable to be an OFBiz hosting database may
be we could think to put your fieldtypefoxpro and all related information on
how to connect to a legacy VFP database in a HOW-TO page in Confluence.
WDYT?
-Bruno
2008/9/2 Nattanicha R. <[EMAIL PROTECTED]>
> Hi Bruno,
> I'm interest in the way that you export VFP to XML format. Does it
> automatically export? or you need to do it manually. How about your
> approach
> to do this (or if you have source code). Please share it for me.
> So, it means that the way that you do, you cannot use locking machanism
> in OFBiz? or you change variable names?
>
> Nattanicha
>
> ????? ??????? 1, 2008 5:28 ??????????, Bruno Busco
> <[EMAIL PROTECTED]>????????:
>
> > Nattanicha,
> > I finally used a simple XML export from VFP and import in OFBiz (this was
> > what I needed).
> > I could not use the JDBC-ODBC because in my applicatio OFBiz runs on a
> > Linux
> > machine and VFP runs on a Windows machine.
> > I could not find a way to access a samba shared ODBC resource on Linux.
> > -Bruno
> >
> > 2008/9/1 Nattanicha R. <[EMAIL PROTECTED]>
> >
> > > Hi, Bruno,
> > > I already created issue in jira
> > > https://issues.apache.org/jira/browse/OFBIZ-1941. I also refered to
> you
> > > that
> > > you are one of member who work in this issue. If you have comments,
> > please
> > > try. Thank you very much for your cooperation.
> > >
> > > Nattanicha (Natty)
> > >
> > > 2008/9/1 Bruno Busco <[EMAIL PROTECTED]>
> > >
> > > > Nattanicha,
> > > > just create a jira issue here
> > > https://issues.apache.org/jira/browse/OFBIZ
> > > > and attach a patch.
> > > >
> > > > BTW how did you finally connect to the DB ? Did you use the ODBC
> driver
> > > or
> > > > the direct VFP jdbc driver?
> > > > -Bruno
> > > >
> > > > 2008/9/1 Nattanicha R. <[EMAIL PROTECTED]>
> > > >
> > > > > Dear all,
> > > > >
> > > > > Last 3 months, I just finished my thesis, which I used OFbiz to
> be
> > > my
> > > > > framework. My work is about connect Visual Foxpro with OFBiz. I
> > already
> > > > > done
> > > > > fieldtypevisualfoxpro.xml that can be worked with locking machanism
> > > that
> > > > > are
> > > > > provided on OFBiz. Can I commit it to SVN? How can I do it?
> Actually,
> > > for
> > > > > using my fieldtypevisualfoxpro.xml to work with lock machanism, I
> > must
> > > > > modify variables in ModelEntity.java because foxpro cannot use
> field
> > > name
> > > > > that is longer than 8 characters. I need to have some suggestion
> for
> > > this
> > > > > issue. If anyone never done it, I think it's very valuable for
> people
> > > who
> > > > > need to use foxpro with OFBiz.
> > > > >
> > > > > Thank you very much,
> > > > > Natty
> > > > >
> > > > >
> > > > > --------------------------------------------------------
> > > > > Master of Science (Software Engineering)
> > > > > Shool of Engineering and Technology
> > > > > Asian Institute of Technology
> > > > > P.O. Box 4, Klongluang, Pathumthani
> > > > > ---------------------------------------------------------
> > > > > [EMAIL PROTECTED]
> > > > > [EMAIL PROTECTED]
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > -----------------^^"Nong Kae^^"-----------------
> > > ???????? ????????????
> > > Nattanicha Rittammanart (Programmer)
> > > Haadthip Public Company Limited
> > > Haadyai, Songkhla
> > > --------------------------------------------------------
> > > Master of Science (Software Engineering)
> > > Shool of Engineering and Technology
> > > Asian Institute of Technology
> > > P.O. Box 4, Klongluang, Pathumthani
> > > ---------------------------------------------------------
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
> > >
> >
>
>
>
> --
> -----------------^^"Nong Kae^^"-----------------
> ???????? ????????????
> Nattanicha Rittammanart (Programmer)
> Haadthip Public Company Limited
> Haadyai, Songkhla
> --------------------------------------------------------
> Master of Science (Software Engineering)
> Shool of Engineering and Technology
> Asian Institute of Technology
> P.O. Box 4, Klongluang, Pathumthani
> ---------------------------------------------------------
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>