Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > adodb query syntax


Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2005, 01:06 AM
winnij winnij is offline
Regular
 
Join Date: Dec 2003
Location: The Netherlands
Posts: 97
Question adodb query syntax


Hello,

I'm (still) using adodb to exhange data between excel files. The query syntax differs a bit from for example MySQL. I'd like to know what the syntax is for an update query, and where i can find the syntax. I've searched in this forum, with google and in msdn but i couldn't find it.

Werner
Reply With Quote
  #2  
Old 11-03-2005, 06:06 AM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

UPDATE tablename SET field1='value1', field2='value2', fieldX='valueX' [WHERE criteriafield='somevalue']
__________________
~ Quod non mortiferum, fortiorem me facit ~

Avatar by lebb
Reply With Quote
  #3  
Old 11-04-2005, 01:23 PM
winnij winnij is offline
Regular
 
Join Date: Dec 2003
Location: The Netherlands
Posts: 97
Default It doesn't work

I'm sorry reboot but your code doesn't work. I tried the code with 'or ` before and after the tablename. Thanks anyway for your reply

Has someone an idea where to find a solution, book or tutorial.
Reply With Quote
  #4  
Old 11-04-2005, 01:50 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
Default

Does Herilane's ADO/Excel tutorial help?

http://www.xtremevbtalk.com/showthread.php?t=217783
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown

Last edited by loquin; 11-04-2005 at 01:59 PM.
Reply With Quote
  #5  
Old 11-04-2005, 01:53 PM
loquin's Avatar
loquin loquin is offline
Google Hound

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
Default

Or, MS

http://support.microsoft.com/default...22120121120120

Remember, you need to wrap your table name (worksheet name) with either square brackets, or with apostrophes. In addition, worksheet names need to be suffixed with the dollar sign ($)

Update [SHEET1$] Set [Column1] = 7 where [Column2] = '12345'
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown

Last edited by loquin; 11-04-2005 at 01:59 PM.
Reply With Quote
  #6  
Old 11-05-2005, 01:21 AM
winnij winnij is offline
Regular
 
Join Date: Dec 2003
Location: The Netherlands
Posts: 97
Default

The brackets around the column name i didnot trie yet. That's the firtst thing i'll try.
The tut from Herilane gives me no help with the sysntax problem. It did help me with making a connection and a recordset.

Thanks for your reply
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->