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

prevent quotes around string in a text file 1

Status
Not open for further replies.

smcmanus

Technical User
Aug 1, 2001
25
CA
I am writing sql statments in VB and dumping them into a text file but the string has quotes around it. e.g.
"INSERT INTO tblPayroll(fldAmount) VALUES(pstrAmount)"
I want to be able to get rid of this quotes on the end. When I run my SQL script it does not work.
 
rather than using VB's write command, use the Print #intFilehandle command. For example . . .

Code:
Dim intFileHandle As Integer
Dim strSQL As String

strSQL = "Select * from Somewhere"
intFileHandle = FreeFile

Open "C:\TestData.Sql" For Append As #intFileHandle
Print #intFileHandle, strSQL
Close #intFileHandle

- Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top