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!

QUERY PROBLEM

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
sConn = "DRIVER={Microsoft Text Driver (*.txt; *.csv)};" & "DefaultDir=" & "C:\Inetpub\ & ";Extensions=asc,csv,tab,txt"

I have the above connection to a csv file,,, my update query is this

update ESCORTLIST set ESCORTLIST.Title = '1997-1998 FORD ESCORT AIR BAG MODULE.' where ESCORTLIST.id = 1

The error is

[Microsoft][ODBC Text Driver] The Microsoft Jet database engine could not find the object 'ESCORTLIST.txt'. Make sure the object exists and that you spell its name and the path name correctly.


...any ideas?

This is my execute code?

rs2.Open sConn
rs2.Execute(sql)
 
I am curious as to why you would be working with a txt file?? I don't see this a very efficient... why dont you use MySQL database? You wouldn't have any trouble like you are having now.

Jason

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
Maybe try:

Dim sConn, sql, rs

sConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\path_to_ESCORTLIST.txt\;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""

sql= "update ESCORTLIST set ESCORTLIST.Title = '1997-1998 FORD ESCORT AIR BAG MODULE.' where ESCORTLIST.id = 1"

rs.Open sConn
rs.Execute(sql)

I'm not good at connection strings, though, so this probably won't work.

 
Tried all that, i'm using the access to work with
 
The good news is you can use the FileSystemObject to edit text files.
 
on to different servers now though SQL
 
Update" or "delete from" is not supported. But I think "insert into" is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top