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

Invalid bracketing of name but not a column heading or file name

Status
Not open for further replies.

DeannaF829

Technical User
Joined
Oct 5, 2007
Messages
8
Location
US
I've been looking in the forums, but not finding exactly what my problem is. I have an SQL Insert that is giving me the error [Microsoft][ODBC Excel Driver] Invalid bracketing of name '[8.28]'.

Here is my query:
strSQL = "Insert Into " & Chr(34) & "Verify_Not_Shipped$" & Chr(34) & " ("
strSQL = strSQL & Chr(34) & "VOID_FLAG" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "REF2" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "CUST_NAME" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "MSTR_TRACK_NO" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "INDIV_TRACK_NO" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "TOTAL_PKGS" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "PU_DATE" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "TOTAL_LIST" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "SVC" & Chr(34) & ","
strSQL = strSQL & Chr(34) & "TOTAL_WEIGHT" & Chr(34) & ")"
strSQL = strSQL & " Values("
strSQL = strSQL & Chr(34) & strDeletedFlag & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMiscellaneousPurchaseOrder & Chr(34) & ","
strSQL = strSQL & Chr(34) & strAddressRecipientCompany & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMasterTrackingNumberTrackNo & Chr(34) & ","
strSQL = strSQL & Chr(34) & strIndivTrackingNumberTrackNo & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMiscellaneousIntlTotalPackages & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMiscellaneousSpecialServicesFutureShipmentShipDate & Chr(34) & ","
strSQL = strSQL & Chr(34) & strListRatesListRatesNetCharge & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMiscellaneousServiceType & Chr(34) & ","
strSQL = strSQL & Chr(34) & strMiscellaneousWeight & Chr(34) & ")"

8.28 is a value of field strListRatesListRatesNetCharge, not a file, column or field name. I don't know how to fix this because if I change the Chr(34) to a single quote, then the value of field strAddressRecipientCompany will fail if it contains an apostrophe, like Manufacturer's or Saint Mary's, etc.
 
Use single quotes.

strAddressRecipientCompany = Replace(strAddressRecipientCompany,"'","''")

will solve the single quote problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top