473,626 Members | 3,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing parameter to ADO recordset from Field

Is there a simple way to pass a parameter to an ADO recordset instead
of using a hard coded where statement like below(something like
forms!aaa!field name). I've done a fair bit of searching but can not
seem to come up with a way to provide this in a simple manner. I have
done this using pass through queries and stored procedures (as a form
based search method)but I guess I am just experimenting to see if the
below is a more efficient way to search large recordsets by passing
parameters from a form or am I just wasting my time
The db in question references both DAO ADO recordsets.

Public Function test4()
Dim cnn As ADODB.connectio n
Dim rst As ADODB.Recordset
Dim strSQL As String
Set cnn = New ADODB.connectio n
Set rst = New ADODB.Recordset
strSQL = "SELECT street, town, id, " & _
"telephonei d " & _
"FROM tble where street like 's%'"
cnn.Open "DSN=do;Descrip tion=do;APP=" & _
"Microsoft Office XP;WSID=;DATABA SE=" & _
"do;Trusted_Con nection=Yes"
rst.Open strSQL, cnn
Forms!aaa.Recor dSource = strSQL
rst.Close
Set rst = Nothing
cnn.Close
Set cnn = Nothing
End Function

Thanks for any assistance

Phill
Nov 12 '05 #1
0 2932

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2394
by: Mike | last post by:
In VB I have a recordset and want to work with specific fields. I realize I can use an index number e.g. rst(23)but I don't like using index numbers in case I change the underlying fields or table later. I also realize you can use a text name of field e.g. rst!"Myfield". But where I am having trouble is when the field has a name such as TblProducts_Location where TblProducts is the table in which the field "Location" resides.
2
1320
by: Khamal | last post by:
need to passing parameter from 1st page to 2nd page... try to use public static void user_param(string namaku ,string umurku ) but still cannot why?? please help... -- :: KHAMAL ::
1
2686
by: adam | last post by:
I am getting an error when trying to use an ADODB.Recordset that was passed from a VB6 application to a VB.Net class library using COM Interop. I am running this on WinXP SP2 using the .Net Framework 1.1 and MDAC 2.8 SP1. This is what I've done: - I compiled the VB.Net DLL and registered it so it can be used in the VB6 app using "regasm /tlb:VBNETClass.tlb VBNETClass.dll". - From the VB6 app, I added a reference to the VB.Net DLL. - I...
1
1424
by: Joe Smith | last post by:
How to pass parameter to a Vb.Net application? ..Net Framework 1.1. Thanks, Joe
1
18514
by: anushree1631 | last post by:
hi I am working in C#.Net 2005. I want the whole code for Passing Parameter in Crystal report Please send it fast It's very urgent with regards, Anushree
1
2105
by: ShadesOfGrey | last post by:
Hello again. Thanks to Gord, I have this cool query that puts my student attendance records in a calendar format in Access 2003. PARAMETERS Text ( 255 ), IEEEDouble; TRANSFORM First(IIf(=1,"S","I")) AS Type SELECT Year() AS , Month() AS , & " " & AS Name FROM Member_List_tbl INNER JOIN Attendance_tbl ON Member_List_tbl. = Attendance_tbl. WHERE ((( & " " & )=) AND ((DatePart("yyyy",))=))
10
1793
by: Hugh Middity2 | last post by:
Hello, is there a parameter value field in access that can be passed between queries, forms and reports? For example, we have two companies both selling the same products. To extract data we have to enter the date twice, once for each company. To print a report we have to enter the date again. Is it possible to enter the date once which can be used by all the processes? Thanks for your help.
2
1708
by: Harmony504 | last post by:
I am passing a form field in JavaScript to a PHP function. The problem is when the parameter gets inside the PHP function the value is set to 1 when it should be a relative path to a file. setup_config.php: <script language="javascript"> function install(){ ... Install.ExecuteDBScript(document.getElementById('path').value, document.getElementById('self-serve').checked, function (result) { alert("result = " + result);
7
5345
by: AmiMitra | last post by:
i am having problem with passing parameter through navigateUrl property of a hyperlink. in the page where i am using the hyperlink , i am getting the data thorugh commonutility. i want to pass this data to the next page through navigateUrl. plz help.
0
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.