Solved

execute multiple queries

Posted on 2006-06-15
4
183 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now