Solved

execute multiple queries

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

705 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