?
Solved

execute multiple queries

Posted on 2006-06-15
4
Medium Priority
?
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

752 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