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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve from a MEMO field using vb6

Status
Not open for further replies.

WaZda

Programmer
Jun 22, 2007
48
GB
Hi everybody
am having a hard time retrieving from a memo field. I connect fine to the database. The insert into command works fine as well. But when i retrieve, there seems to be nothing in the table. And even if i open foxpro6 and type in some details in the memo field, when i try to retrieve them with my vb6 application, it always returns a "null" value. Here is my codes

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 carac 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. Someone please help.

WaZda
 
The correct syntax for INSERT into is

INSERT INTO dbf_name [(FieldName1 [, FieldName2, ...])]
VALUES (eExpression1 [, eExpression2, ...])

in your command
Code:
con.Execute ("insert into Type_surete values('" & Trim$(txtCarac.Text) & "')")
I do not see a field name



David W. Grewe Dave
 
the insert insert into works fine. When i change the memo field to "character" the insert into syntax works fine. The memo is the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top