Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Error when updating Access table from Excel Worksheet

Reply
 
Old 08-09-2009   #1 (permalink)
Glenn


 
 

Error when updating Access table from Excel Worksheet

I've written a VBS script to update an Access table based on an Excel
spreadsheet.

The column that I'm using in Excel to match up in Access is called
"UserDisplayName".

The data in that column contains a comma in it. (For instance: Smith,
John).

When I try to run the script I get an error: Syntax error (comma) in query
expression 'UserDisplayName=Smith, John' code: 80040E14.

I'm not quite sure what to here. If I got into access and do a SQL Query,
I'm able to query something that has a comma in it.

Any suggestions?

Thanks.



My System SpecsSystem Spec
Old 08-09-2009   #2 (permalink)
ekkehard.horner


 
 

Re: Error when updating Access table from Excel Worksheet

Glenn schrieb:
Quote:

> I've written a VBS script to update an Access table based on an Excel
> spreadsheet.
>
> The column that I'm using in Excel to match up in Access is called
> "UserDisplayName".
>
> The data in that column contains a comma in it. (For instance: Smith,
> John).
>
> When I try to run the script I get an error: Syntax error (comma) in query
> expression 'UserDisplayName=Smith, John' code: 80040E14.
>
I *suppose* your SQL statement misses the single quotes necessary to delimit
string values. If changing your statement/code to

... UserDisplayName='Smith, John' ...

or

... UserDisplayName='" & strNsme & "' ...

don't work, please post the full statement/code to produce it.
Quote:

> I'm not quite sure what to here. If I got into access and do a SQL Query,
> I'm able to query something that has a comma in it.
>
> Any suggestions?
>
> Thanks.
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can not open an existing Excel worksheet PowerShell
Excel Worksheet Tabs Disappeared in vista 64 Microsoft Office
Finding the last row of and excel worksheet. VB Script
How to determin a worksheet exist in Excel? PowerShell
Excel Worksheet PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46