Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: apostrophe quote marks quotes
retcode = qExecDirect(hstmt,INSERT Into MyTable (Column_1) VALUES ('Joe's Bar and Grill'))
First, I just think OLE code is smaller in size and complexity, and since WB's OLE Extender parallels VB Script, you can use the VB trick of doubling quotes or apostrophes to get a single one in a field.
Just change the path variable to suit your situation, and this assumes you have MDAC 2.5 or 2.6 installed.
BoxOpen("Test Script","Creating/Inserting dBase IV") cPath = "E:\WBDEMO\ If FileExist("%cpath%DBF.DBF") FileDelete("%cpath%DBF.DBF") Endif cConn = "Provider=MicroSoft.Jet.OLEDB.4.0; Data Source=%cPath%;Extended Properties=dBASE IV" DB = ObjectOpen("ADODB.Connection") DB.Open(cConn) step=1 cSQL = "CREATE TABLE DB4 ( COLUMN_1 TEXT(50) );" DB.Execute(cSQL) ;this works ;cSQL = "INSERT INTO DB4 ( COLUMN_1 ) VALUES ('Joes Bar and Grill');" ;or this to include apostrophe in field var="Joe''s Bar and Grill" cSQL = "INSERT INTO DB4 ( COLUMN_1 ) VALUES ('%var%');" DB.Execute(cSQL) DB.close() ObjectClose(DB) BoxShut() exit
Article ID: W14914
File Created: 2001:11:08:12:40:58
Last Updated: 2001:11:08:12:40:58