• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

SQL2000 VBS Select

Hi Guys,

Server = windows 2000 Server.  
DNS Name = SQL3.Worknet.company.int
SQL = SQL 2000 Server
Database = CM

I need the VBS Code that will connect to the database's TblStaff_A table, select all Forenames and Surnames and give a popup message with the names (message box)

500 (Hopefully) easy ones :)
0
Pearl_export_ben
Asked:
Pearl_export_ben
  • 4
  • 3
  • 2
1 Solution
 
RiteshShahCommented:
0
 
RiteshShahCommented:
0
 
Pearl_export_benAuthor Commented:
Nah - i need a sample script to put into a vbs file... very long story as to why, but to cut it short - i needs it to be this way as its part of something bigger
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
1 single pop up message with the data of those 2 columns for ALL the rows at once?
or
1 pop up message for each row, ie popping up all the time until all rows have been processed?

anyhow, what exactly is the code problem?
what can you do already? (note that EE is not a rent-a-coder site)
0
 
Pearl_export_benAuthor Commented:
1 popup for each result returned...

I just need a framework which i can add my code into
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I see. anyhow, I have to repeat:

anyhow, what exactly is the code problem?
what can you do already? (note that EE is not a rent-a-coder site)
0
 
Pearl_export_benAuthor Commented:
The exact problem is that I need to extract some data from a table on an SQL server, manipulate it and then stick it into a different data form.

I have managed to code the part that will manipulate stuff once its into a variable and then put it up into the spreadsheets and documents and such like.. its just getting the data from the sql server to begin with I can't do.  I've been working on it for 3 days, but SQL isn't really my area at all
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
let's start with this code to query a table:
dim con 
dim rst
 
dim strLastName
dim strfirstName
 
set con = createobject("ADODB.Connection")
con.open "<your connection string>"
' check out www.connectionstrings.com to "build" your connection string
 
set rst = con.execute("select firstname, lastname from yourtable ")
while not rst.eof
  
  strLastName = rst.fields("lastname").value
  strFirstName = rst.fields("firstname").value
 
  rst.movenext
wend
 
rst.close
set rst = nothing
con.close
set con = nothing

Open in new window

0
 
Pearl_export_benAuthor Commented:
Fantastic Answer - Thankyou :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now