Click here to Skip to main content
15,918,343 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: images in list view columns Pin
f6411-May-04 15:46
f6411-May-04 15:46 
GeneralRe: images in list view columns Pin
Moonark11-May-04 17:07
Moonark11-May-04 17:07 
QuestionHow to use Amazon Web Services.. Pin
Sumit Kapoor11-May-04 2:42
Sumit Kapoor11-May-04 2:42 
GeneralDumping Symbols fom DLLs Pin
StuartBird11-May-04 1:45
StuartBird11-May-04 1:45 
GeneralVB SCRIPT Help required Pin
prashantnemane10-May-04 23:36
prashantnemane10-May-04 23:36 
GeneralRe: VB SCRIPT Help required Pin
mtone11-May-04 2:02
mtone11-May-04 2:02 
GeneralRe: VB SCRIPT Help required Pin
prashantnemane12-May-04 17:40
prashantnemane12-May-04 17:40 
GeneralRe: VB SCRIPT Help required Pin
mtone13-May-04 4:11
mtone13-May-04 4:11 
It Is Sir.

Here is a quick sample. Best to read up on ADO. it would be the same in script except set the Objects Set recordSet = CreateObject("ADODB.Recordset") and Set connectionObj = CreateObject("ADODB.Connection")
This assumes ODBC settings for DSN
Don't forget to reference ADODB in project

    Public Const CURSOR_TYPE = 3<br />
    Public Const LOCK_TYPE= 3<br />
<br />
Dim connectionString as string<br />
Dim sql as string<br />
Dim connectionObj As New ADODB.Connection()<br />
Dim recordSet As New ADODB.Recordset()<br />
<br />
connectionString = "dsn=DSN;uid=USER_ID;pwd=USER_PASSWORD;database=DATABASE_NAME<br />
sql = "SELECT name FROM sysobjects"<br />
<br />
connectionObj.Open(connectionString) <br />
<br />
'There are Many ways to access an retrieve data this is just one sample<br />
<br />
recordSet = connectionObj.Execute(sql)<br />
OR<br />
recordSet.Open(sql, connectionObj, CURSOR_TYPE, LOCK_TYPE)<br />
<br />
'Loop thru Record set (row) I believe this is only forward reading<br />
<br />
With recordSet<br />
                    Do Until .EOF<br />
			<br />
			'Get the COlumns in the Row and do something set to varilable, call other routine, etc..<br />
			.Fields("name").Value ' this is the column name in the select statment (sql)<br />
				OR <br />
			.Fields.Item(0) ' also the column name, specify the column index number 0 to however many columns<br />
			<br />
			.MoveNext() ' go to next record<br />
                    Loop<br />
End With


Good Luck
GeneralColumn Names in DATA GRID Pin
seemeenejaz10-May-04 22:40
seemeenejaz10-May-04 22:40 
GeneralRe: Column Names in DATA GRID Pin
Syed Abdul Khader11-May-04 1:11
Syed Abdul Khader11-May-04 1:11 
GeneralRe: Column Names in DATA GRID Pin
Nick Seng11-May-04 23:31
Nick Seng11-May-04 23:31 
Generalcalling a stored procedure from VB Pin
FASTian10-May-04 22:39
FASTian10-May-04 22:39 
GeneralRe: calling a stored procedure from VB Pin
Dave Kreskowiak11-May-04 1:27
mveDave Kreskowiak11-May-04 1:27 
GeneralRe: calling a stored procedure from VB Pin
FASTian12-May-04 0:22
FASTian12-May-04 0:22 
GeneralIE Pin
jithen_dt10-May-04 21:19
jithen_dt10-May-04 21:19 
GeneralRe: IE Pin
Colin Angus Mackay11-May-04 1:06
Colin Angus Mackay11-May-04 1:06 
GeneralRe: IE Pin
Edbert P11-May-04 16:58
Edbert P11-May-04 16:58 
GeneralIE Explorer Pin
Anonymous10-May-04 20:54
Anonymous10-May-04 20:54 
GeneralData grid with check boxes Pin
seemeenejaz10-May-04 19:18
seemeenejaz10-May-04 19:18 
GeneralRe: Data grid with check boxes Pin
Syed Abdul Khader10-May-04 22:07
Syed Abdul Khader10-May-04 22:07 
GeneralRe: Data grid with check boxes Pin
seemeenejaz10-May-04 22:37
seemeenejaz10-May-04 22:37 
GeneralRe: Data grid with check boxes Pin
Syed Abdul Khader10-May-04 22:49
Syed Abdul Khader10-May-04 22:49 
Generalneed some help making a bitmap appear Pin
kowplunk10-May-04 16:19
kowplunk10-May-04 16:19 
GeneralRe: need some help making a bitmap appear Pin
Christian Graus10-May-04 16:57
protectorChristian Graus10-May-04 16:57 
GeneralRe: need some help making a bitmap appear Pin
kowplunk10-May-04 17:08
kowplunk10-May-04 17:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.