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!

ADO Connection Conversion 1

Status
Not open for further replies.

TX1135

Programmer
Aug 22, 2002
2
NZ
I am having trouble converting the following connectionstring and its conversion to vbscript.
Currently it works, allowing a recordset to be populated by a textfile.
However, I need to be able to set the DataSource to look at the current path where this file is running.
It could be on a CDDrive for example.

Con.Open "Provider=Microsoft.Jet.OLEDB.4.0; & DataSource=c:\wmsHTML;Extended & Properties='text;HDR=YES;FMT=DELIMITED'"

Being new to vbscript - Am I heading off on a silly tangent.
Any suggestions would be appreciated.
 
Set oFSO = CreateObject("Scripting.FileSystemObject")
lcpath= oFSO.GetFile(WScript.ScriptFullName).ParentFolder.Path
Set oFSO = Nothing

Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=" & lcPath & ";Extended & Properties='text;HDR=YES;FMT=DELIMITED'"
Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top