[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

execute multiple queries

Posted on 2006-06-15
4
Medium Priority
?
196 Views
Last Modified: 2010-04-30
my application requires the user to type in a parcel number. With that parcel Id I would like to search one table and a view. Basically the one table is applications already processed according to parcel Id. The view(sql server 2000) is data from a another DataBase that applications have not been done on it. I want the app to search the table, if no entries are found(according to the Parcel Id user typed in) then search the view(there will always be data associated with that parcel Id in the view)If there is app already the use can review it, if there is not the user can create a new app from the basic info found in the "view".
My view works fine, My table works fine. I just can't get them to work together.

0
Comment
Question by:ircpamanager
  • 2
4 Comments
 
LVL 5

Author Comment

by:ircpamanager
ID: 16912658
i am using ado and i am displaying results of query in textboxes on form
thanks in advance
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 16918014
From what you said I understand that your table and view are not in the same database. SO,

Just use separate 'connection strings ' for the 2 databases. Open the table and view separately and check.
0
 
LVL 5

Author Comment

by:ircpamanager
ID: 16919432
I am sorry if I explained it that way. the table and view are attached to the same database.
0
 
LVL 5

Accepted Solution

by:
patingsadagat earned 2000 total points
ID: 16923749
Dim rs As New ADODB.Recordset, rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
   
cn.Open "your connection string"
cn.CursorLocation = adUseClient
   
rs.Open "Select * From Table1 where ParcelID='" & txtParcelID.Text & "'"
if rs.eof then
     rs1.Open "Select * From View1 where ParcelID='" & txtParcelID.Text & "'"
     if rs1.eof then
          'code to add new values here
     else
          'code to display values to textboxes here
     end if
     rs1.close
     set rs1 = nothing
else
      'code to display values to textboxes here
end if
rs.close
cn.close
set rs = nothing
set cn=nothing
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question