Hi,
I have a large amount of information from a 2.x fox database that I want to scan & insert into a mysql database so that I have more control over the results than through the sqldump. I also hoped to be able to use the same process when bringing in daily activity.
The steps I have taken so far to bring me to the edge of my emotional cliff.
1. I have brought in the data into a Fox Cursor in VFP8 SP1.
2. I have also created a CursorAdapter to the mySQL table which does display the existing data using the builder. The code generated in the init method follows:
As I said the CursorAdapter cursor is displayed.
I then scan the Fox Cursor with the following code
The TranDate
and Active
fields are updated correctly but the Character fields agencyNumber & agencyname
do not get updated.
The schema for the CA is as follows:
I have tried changing the Character fields to different types (char, tinytext, medtext, text) with no change in the results.
If I look at the cursor for the CursorAdaptor I am allowed to enter values in the AgecnyNumber and AgencyName fields but when I move out of the field the changes are lost. On the Trandate, Active and UserID fields my changes stick.
I honestly thought I might have trouble converting the date but text fields?
Any ideas or code samples would be greatly appreciated.
Sincerely,
Michael
Michael Brennan-White
New Hampshire Treasury Department
![[bugeyed] [bugeyed] [bugeyed]](/data/assets/smilies/bugeyed.gif)
The steps I have taken so far to bring me to the edge of my emotional cliff.
1. I have brought in the data into a Fox Cursor in VFP8 SP1.
2. I have also created a CursorAdapter to the mySQL table which does display the existing data using the builder. The code generated in the init method follows:
Code:
[COLOR=green]
local llReturn
do case
case not pemstatus(This, '__VFPSetup', 5)
This.AddProperty('__VFPSetup', 0)
case This.__VFPSetup = 2
This.__VFPSetup = 0
return
endcase
llReturn = dodefault()
*** Setup code: DO NOT REMOVE
***<SelectCmd>
text to This.SelectCmd noshow
select lagency.* from lagency
endtext
***</SelectCmd>
***<KeyFieldList>
text to This.KeyFieldList noshow
AGENCYID
endtext
***</KeyFieldList>
***<UpdateNameList>
text to This.UpdateNameList noshow
AGENCYID lagency.AGENCYID, AGENCYNUMBER lagency.AGENCYNUMBER, AGENCYNAME lagency.AGENCYNAME, TRANDATE lagency.TRANDATE, ACTIVE lagency.ACTIVE, USERID lagency.USERID
endtext
***</UpdateNameList>
***<UpdatableFieldList>
text to This.UpdatableFieldList noshow
AGENCYNUMBER, AGENCYNAME, TRANDATE, ACTIVE, USERID
endtext
***</UpdatableFieldList>
*** End of Setup code: DO NOT REMOVE
if This.__VFPSetup = 1
This.__VFPSetup = 2
endif
return llReturn
[/color]
I then scan the Fox Cursor with the following code
Code:
[COLOR=green]
USE lAgency
SCAN
INSERT INTO caAgency (AgencyNumber, ;
AgencyName, ;
TranDate, Active) ;
VALUES (lAgency.AgencyNumber, ;
lAgency.AgencyName, ;
TTOD(lAgency.TranDate),1)
SELECT lAgency
ENDSCAN
[/color]
Code:
[COLOR=purple](Date)[/color]
Code:
[COLOR=purple](TinyInt)[/color]
Code:
[COLOR=purple](VarChar)[/color]
The schema for the CA is as follows:
Code:
[COLOR=purple]
AGENCYID I, AGENCYNUMBER C(4), AGENCYNAME C(60), TRANDATE D, ACTIVE I, USERID I
[/color]
If I look at the cursor for the CursorAdaptor I am allowed to enter values in the AgecnyNumber and AgencyName fields but when I move out of the field the changes are lost. On the Trandate, Active and UserID fields my changes stick.
I honestly thought I might have trouble converting the date but text fields?
![[bugeyed] [bugeyed] [bugeyed]](/data/assets/smilies/bugeyed.gif)
Sincerely,
Michael
Michael Brennan-White
New Hampshire Treasury Department