Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
'MySQL
'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
'MS-SQL
sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (" & PageID & ", '""" & TestFixString(PageText) & """', " & NextPageID & ", " & WDBVersion & ", " & CLng(CheckSum) & ")"
God VB is ugly..
Anyway, MySQL and MSSQL have almost exactly the same usage, it's just the inside bits that are substantially different.
Is it really so bad to make mass edits to the query strings? If your transforms are reasonably consistent, one could write a sed or awk script to do it pretty easily. Sed would probably be a better choice here, since it's a stream editor.
Quote from: l)ragon on September 30, 2006, 06:35 PM
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
'MySQL
'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
[/quote]
Looks like MySQL was broken. IIRC, you're not supposed to have quotes around numeric values in ANSI SQL.
Quote from: MyndFyre[vL] on October 06, 2006, 03:07 PM
Quote from: l)ragon on September 30, 2006, 06:35 PM
Whats the best way to go around this without haveing to make mass edits to all the query strings EG:.
'MySQL
'sqlCRQuery = "INSERT INTO " & db_item_Header & "(" & db_item_PageID & ", " & db_item_PageText & ", " & db_item_NextPage & ", " & db_item_WDBVersion & ", " & db_item_Checksum & ") VALUES (""" & PageID & """, """ & TestFixString(PageText) & """, """ & NextPageID & """, """ & WDBVersion & """, """ & CLng(CheckSum) & """)"
[/quote]
Looks like MySQL was broken. IIRC, you're not supposed to have quotes around numeric values in ANSI SQL.
That works so does the other line, I'm just rewriteing all my lines.