
Pulling TEXT datatype into a VB5 app
I'm pulling data out of FoxPro 2.6 tables and putting it into an Informix
database on OLWS 7.23, and am running into a problem. The FoxPro program
uses "memo" fields to store notes, which are important to the users. Some
of these notes are pretty large, possibly 3k or more, so a 255 character
field will not be enough. I decided to use the TEXT field on Informix to
give me a large area to store notes and not be worried about running out of
room. Unfortunately, I can't get the notes back *out* of the Informix
database.
When I first converted the data, I couldn't shoot it directly from FoxPro
into Informix, because I kept getting a null error from FoxPro. I had to
temporarily store it in a string variable, then put it into Informix, like
this:
Dim rstQuery as recordset ' data coming from foxpro
Dim rstInformixTable as rdoResultset ' target on Informix database
Dim tmpString as string
set rstQuery = dbsFoxPro.OpenRecordset("vndmast", dbOpenDynaset)
SQL = "SELECT * FROM splrmast"
set rstInformixTable = conInformix.OpenResultset(SQL, rdOpenKeyset,
rdConcurRowVer)
... ' code to loop through rstQuery and add record to rstInformixTable
tmpString = rstQuery!notes
rstInformixTable!notes = tmpString
... ' other code
This is the only way it would work. Now that I have all the data in an
Informix db, I query a supplier id and try to get the notes back out, and I
get an invalid use of null error, even after testing it for null. Here's
an example:
SQL = "SELECT * FROM splrmast WHERE splr_id = '00694'
set rstQuery = conSMS.OpenResultset(SQL, rdOpenKeyset)
' blah blah blah
if not isnull(rstQuery!notes) then
tmpString = rstQuery!notes
else
tmpString = ""
end if
When there is something in the field "notes", I get an "invalid use of
null" error when I try to assign it to tmpstring. Note this is *after* the
isnull test is successful!
I need to be able to read the notes and put them into a text box on a form.
Does anyone have any ideas?
Phillip Koebbe
Eagle-Picher Technologies, LLC.