ND_2007
asked on
Append text to DBF File in VB.net ala "Append From" FoxPro command
Hi!! I am attempting to append text into a dbf of the same layout through VB.NET.
In foxPro I would use the "APPEND FROM mytable.txt delimited with tab" command for a tab delimited file for example and foxpro will append the text into the correct fields as long as the schema is identical.
Does anyone know how to do this though VB? I normally would use the Access .COM object and just do this in SQL but there is no equivelent to the FoxPro "Append From text" command that I know of in SQL
any help is appreciated
In foxPro I would use the "APPEND FROM mytable.txt delimited with tab" command for a tab delimited file for example and foxpro will append the text into the correct fields as long as the schema is identical.
Does anyone know how to do this though VB? I normally would use the Access .COM object and just do this in SQL but there is no equivelent to the FoxPro "Append From text" command that I know of in SQL
any help is appreciated
an sql equivalent to append from is insert into table from (subquery), and it's suported by VFP9. While it needs a vfp source for the subquery, that source can be a cursor created by remote dta acess.
You may alos simply use what you know: foxpro's append from command, via oledb provider. If you store whatever source you have in VB to another dbf or tab delimited text file or some other formats supported by append.
Bye, Olaf
You may alos simply use what you know: foxpro's append from command, via oledb provider. If you store whatever source you have in VB to another dbf or tab delimited text file or some other formats supported by append.
Bye, Olaf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks! - the automation was exactly what i was looking for.
ASKER
Here's what ended up working for me. Much thanks to CaptainCyril and and everyone that responded
Dim oVFP = CreateObject("VisualFoxPro .Applicati on")
With oVFP
.DoCmd("USE " & sDBFpath)
.DoCmd("APPEND FROM " & sTXTpath & " TYPE DELIMITED")
oVFP.docmd("CLOSE ALL")
End With
oVFP = Nothing
Dim oVFP = CreateObject("VisualFoxPro
With oVFP
.DoCmd("USE " & sDBFpath)
.DoCmd("APPEND FROM " & sTXTpath & " TYPE DELIMITED")
oVFP.docmd("CLOSE ALL")
End With
oVFP = Nothing
Perhaps add an oVFP.Quit() before setting it Nothing. Else you're not quitting the VFP session, you'd find a vfp exe in the taks manager processes tab.
Bye, Olaf.
Bye, Olaf.
While I don't doubt that there are gurus here who know VB in addition to VFP, why do you think that this is a question for a FP/VFP forum? There is no question here regarding FP/VFP code or FP/VFP application development.
Maybe you should try posting your question to a forum related to your VB question.