Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).![]() |
![]() |
|
Thread Tools |
![]() |
#1 |
Guest
Posts: n/a
|
![]()
Hi,
Who can give me the VB code to connect to a SQL DB and get the results of two SELECT COUNT queries. It'll save me looking it up! The syntax i used in vbscript isnt playing. I need it so i can publish the results to a running Performance Counter which is logged in 3rd software. Since this package doesnt support vbscript i've had to go this way..... ![]() |
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
![]()
VB for Very Bad
|
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
![]()
Helpful, buts its only meant as a short term solution until its integrated into the bespoke software.
|
![]() |
![]() |
#4 |
The Sick Man
Mega Poster
Join Date: Nov 2004
Location: Peckham.SE.LDN
Posts: 4,768
|
![]()
I only realy know ASP VB not VB per say.
Have a look here. http://www.freevbcode.com/ShowCode.Asp?ID=1257 http://vijis.sys.virginia.edu/Developers/DBconnect.htm
__________________
OTR: KTM 690 Duke R 2015 Full Akro SIDELINE: Kwak ZX636 A1P 2002, Red, R&G's, Yoshi, Double Bubble Screen GONE: Kwak ZX-7R P1, Full Akro, Undertray, Screen GONE: SV650S K2 Very Bruised & Without Fairing, Motovation Frame Sliders, R&G Ally Sprocket Toe Protector, HEL 2 Line Setup, GSXR K1 600 RWU Forks, Barnett Clutch & Springs, Penske 8981 Shock, Gilles Ti Rearsets, Steel Barends, Scottoiler, AFAM Chain & Sprockets, Twin FIAMM Horns, Skidmarx Bellypan, Full Micron Zeta Steel System, Cut down undertay. Forum Problems & Information / Site Suggestions |
![]() |
![]() |
![]() |
#5 |
Member
Mega Poster
Join Date: Mar 2004
Location: Not in Yorkshire. (Thank God)
Posts: 4,116
|
![]()
vb? sorry i use java and C#.net Don't be so lazy ...look it up
__________________
Not Grumpy, opinionated. |
![]() |
![]() |
![]() |
#6 |
Guest
Posts: n/a
|
![]()
this should get it into a recordset object in vbscript
set objConnection = createObject("ADODB.Connection") set objRecordset = createObject("ADODB.Recordset") objConnection.Open "DSN=<your preconfigured DSN>;" objRecordset.CursorLocation = 4 objRecordset.Open "SELECT COUNT(colname) FROM YOURTABLE" ,objConnection,3,3 objRecordset.Close objConnection.Close |
![]() |
![]() |
#7 |
The Sick Man
Mega Poster
Join Date: Nov 2004
Location: Peckham.SE.LDN
Posts: 4,768
|
![]()
VBScript diffrent from proper VB
__________________
OTR: KTM 690 Duke R 2015 Full Akro SIDELINE: Kwak ZX636 A1P 2002, Red, R&G's, Yoshi, Double Bubble Screen GONE: Kwak ZX-7R P1, Full Akro, Undertray, Screen GONE: SV650S K2 Very Bruised & Without Fairing, Motovation Frame Sliders, R&G Ally Sprocket Toe Protector, HEL 2 Line Setup, GSXR K1 600 RWU Forks, Barnett Clutch & Springs, Penske 8981 Shock, Gilles Ti Rearsets, Steel Barends, Scottoiler, AFAM Chain & Sprockets, Twin FIAMM Horns, Skidmarx Bellypan, Full Micron Zeta Steel System, Cut down undertay. Forum Problems & Information / Site Suggestions |
![]() |
![]() |
![]() |
#8 |
Guest
Posts: n/a
|
![]()
Link to the queries using a data control and view the query through a datagrid
No code needed to do this (you might need to add these controls) if you want to take it further recordsets use a load of methods like update, copy, edit, requery etc. hope this has helped |
![]() |
![]() |
#9 |
Guest
Posts: n/a
|
![]()
Sorted it! Its been so long since i did any VB "proper" that i'd forgot a few things.....
![]() I now have two working performance counters monitoring the number of records in two tables. :thumsbup: Hopefully this monitoring software will log and alert to it automatically like its supposed to! |
![]() |
![]() |
#10 |
Guest
Posts: n/a
|
![]()
tsm, i saw the word vbscript in the post and must have ignored the rest
![]() ![]() ![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
secure file server | DoubleD | Idle Banter | 5 | 27-09-06 12:46 PM |
SQL server | Gnan | Idle Banter | 2 | 31-05-06 05:40 AM |