Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MEMO field in FoxPro

Status
Not open for further replies.

WaZda

Programmer
Jun 22, 2007
48
GB
hi every body,
am dealing with a foxpro6 database and am having a hard time inserting into the memo field of the table. Save for retrieving from a memo field. Can someone tell me what the problem is? and how to solve it? am using vb6
Thanks for helping.

WaZda
 
Please post the following code:

1. The code you're using to set up access to the Foxpro database
2. The code you're using to insert into the memo field

Thanks,

Bob
 
ok, here is the code to access the database:

Code:
With con
    .Provider = "MSDASQL"
    .ConnectionString = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & Path & ";Exclusive=No;Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;"
    .Open
End With

this is how i retrieve from the table. And i always get "null" from the the table. even though i've opened the table in foxpro and inserted details into the field. it still returns the "null" value.

Code:
Set rsNature = con.Execute("select * from Nature_surete order by id_nature")

txtCarac = Trim$(rsNature!carac)

And this is how i insert into. The code works fine. But nothing is inserted into the field. The field remains empty in the table after a successful insert into command.

Code:
con.Execute ("insert into Type_surete values('" & Trim$(txtCarac.Text) & "')")

I hope i was clear enough. If any other information is needed, please let me know. Am stuck.

WaZda
 
Ok. The only thing I can see that I wouldn't do is to use the word "Path" as a variable; it's used in a lot of places so you might get problems. I would change it to something like dbPath.

Other than that, the VB syntax looks fine. You probably should post in the Foxpro forum and see if it's an issue with your connectionstring or something.

HTH

Bob
 
Does your Type_surete table have only one field?
By your insert statement, it looks like you have only one field in the table.
Code:
con.Execute ("insert into Type_surete [blue](MyFieldName)[/blue] values('" & Trim$(txtCarac.Text) & "')")

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top