Click here to Skip to main content
16,005,339 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalcreating a "please wait" dialog Pin
sagmam5-Sep-04 7:19
sagmam5-Sep-04 7:19 
GeneralRe: creating a "please wait" dialog Pin
Greg Eales6-Sep-04 2:02
Greg Eales6-Sep-04 2:02 
GeneralRe: creating a "please wait" dialog Pin
sagmam12-Sep-04 2:48
sagmam12-Sep-04 2:48 
GeneralRe: creating a "please wait" dialog Pin
jonathan156-Sep-04 4:27
jonathan156-Sep-04 4:27 
GeneralConnecting to SQL Server DB Pin
RamBhatt5-Sep-04 4:13
RamBhatt5-Sep-04 4:13 
GeneralRe: Connecting to SQL Server DB Pin
Mekong River5-Sep-04 7:27
Mekong River5-Sep-04 7:27 
GeneralRe: Connecting to SQL Server DB Pin
RamBhatt5-Sep-04 20:03
RamBhatt5-Sep-04 20:03 
GeneralRe: Connecting to SQL Server DB Pin
jonathan156-Sep-04 4:38
jonathan156-Sep-04 4:38 
first is to create a reference to the ado library. to do this select references from the project menu and tick the 'microsoft ActiveX Data Objects 2.7 Library' box.

The Code to connect to SQL Server and Create a basic recordset is as follows:


dim cn As ADODB.Connection
dim rs as ADODB.Recordset


Set cn = New ADODB.Connection
cn.ConnectionTimeout = 25
cn.CommandTimeout = 120

cn.Provider = "sqloledb"
cn.Properties("Data Source").Value = YourServerName
cn.Properties("Initial Catalog").Value = YourDatabaseName cn.CursorLocation = adUseClient
cn.Properties("Integrated Security").Value = "SSPI" 'If using Windows integrated security
cn.Open


set rs = new ADODB.Recordset
rs.open "Select * from yourTable",cn

You now have a basic recordset

Dont forget to close everyhing and set to nothing when your done.

Sorry if it sounds basic but you did say you are a beginner




Jon
GeneralRe: Connecting to SQL Server DB Pin
Mekong River6-Sep-04 5:11
Mekong River6-Sep-04 5:11 
Generalsuccess Pin
RamBhatt6-Sep-04 18:25
RamBhatt6-Sep-04 18:25 
GeneralRe: success Pin
Mekong River7-Sep-04 21:42
Mekong River7-Sep-04 21:42 
GeneralRe: success Pin
RamBhatt8-Sep-04 3:44
RamBhatt8-Sep-04 3:44 
QuestionHow to use Pin
Murtuza Husain Miyan Patel5-Sep-04 4:08
professionalMurtuza Husain Miyan Patel5-Sep-04 4:08 
AnswerRe: How to use Pin
Mekong River5-Sep-04 7:22
Mekong River5-Sep-04 7:22 
GeneralDeleting contents of history folder Pin
nitin_ion4-Sep-04 0:33
nitin_ion4-Sep-04 0:33 
GeneralRe: Deleting contents of history folder Pin
Mekong River6-Sep-04 5:28
Mekong River6-Sep-04 5:28 
GeneralRe: Deleting contents of history folder Pin
nitin_ion6-Sep-04 19:00
nitin_ion6-Sep-04 19:00 
GeneralRe: Deleting contents of history folder Pin
Mekong River6-Sep-04 21:31
Mekong River6-Sep-04 21:31 
GeneralText color on forms Pin
Kevnar3-Sep-04 21:17
Kevnar3-Sep-04 21:17 
GeneralCrystal Report 9 + VB6 Pin
spn3-Sep-04 20:37
spn3-Sep-04 20:37 
GeneralRe: Crystal Report 9 + VB6 Pin
Anonymous5-Sep-04 17:13
Anonymous5-Sep-04 17:13 
GeneralRetrieve TopMost Visible Row Pin
beowulfagate3-Sep-04 19:55
beowulfagate3-Sep-04 19:55 
GeneralCreate city Map to locate location Pin
Rashid Ali Khan3-Sep-04 16:43
Rashid Ali Khan3-Sep-04 16:43 
GeneralRe: Context Sensitive Help ? on a toolbar or button Pin
Anonymous3-Sep-04 11:26
Anonymous3-Sep-04 11:26 
GeneralRe: Context Sensitive Help ? on a toolbar or button Pin
siacom3-Sep-04 11:48
siacom3-Sep-04 11:48 

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.