Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2006, 03:22 PM
Authorized User
 
Join Date: Dec 2004
Location: Honolulu, HI, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Select and Recordset question

I'm sure this is an easy one, but I can't seem to puzzle out the right code to use. I'm attempting to use an SQL statement to obtain a list of records and am not sure what code I should be using. Obviously RunSQL is inappropriate and I can't seem to get the RecordSet objects and methods to work properly.

 
Old June 1st, 2006, 04:18 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You probably will need to provide a little more information.
Are you attempting to use ADODB? There are numerous tutorials and how-to's out on the web with examples of how to do this.
What specifically are you having trouble with?

Woody Z http://www.learntoprogramnow.com
 
Old June 1st, 2006, 05:28 PM
Authorized User
 
Join Date: Dec 2004
Location: Honolulu, HI, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I want to do a simple sql select on a table to get an id to use in an update query. A user enters a first name, last name and date of birth which I want to use as the select criteria to search a table for the associated id.

I have the SQL to obtain the id but can't remember the code to use to save the returned result.

Hope that makes sense.
 
Old June 2nd, 2006, 04:39 PM
Authorized User
 
Join Date: Dec 2004
Location: Honolulu, HI, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This question might belong in the Beginning VB Database forum rather than this one.
 
Old June 24th, 2006, 09:37 AM
Authorized User
Points: 312, Level: 6
Points: 312, Level: 6 Points: 312, Level: 6 Points: 312, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2006
Location: Orpington, Kent, United Kingdom.
Posts: 73
Thanks: 1
Thanked 1 Time in 1 Post
Default

If by 'save' you mean update another table, the code is as follows. Creat the appropriate DYNASET,(N.B. it is vital you create a DYNASET rather than any other type of Recordset as this is 'updateable') let's say you've called it MyDynaset then ...


MyDynaset.Edit
MyDynaset!fieldname= txtID.Text (or whatever)
 and so on for each field
MyDynaset.Update

Hope this helps.liamfitz.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM
Recordset Update question smarks Classic ASP Databases 2 March 14th, 2005 03:57 AM
Question regarding recordset emachines Access VBA 3 March 3rd, 2005 08:52 AM
Recordset delete question/problem bleutiger Classic ASP Databases 1 February 25th, 2005 07:50 AM
Chapter 13; Using Recordset question ou812 BOOK: Beginning ASP 3.0 2 November 7th, 2003 12:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.