October 20, 2003 at 6:31 am
Im fairly new to SQL Server but wish to create an application in VB (6.0) with a small SQL Server DB back end. Is this possible and easy to do?
Cheers guys
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
October 20, 2003 at 6:39 am
Hi Andrew,
quote:
Im fairly new to SQL Server but wish to create an application in VB (6.0) with a small SQL Server DB back end. Is this possible and easy to do?
welcome back
Getting a basic app skeleton using VB6 isn't really difficult.
I think depending on your VB edition, you can choose from File-> New project the entry 'Data project'. VB add automatically references to ADO and to ADO controls. That's a basic start, but using ADO with VB is very well documented.
However, be prepared to hand code more than say in Access.
And the reporting engine in VB isn't by far that brilliant as Access Report Generator.
And, as always, if you got any questions, come back and ask.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
October 20, 2003 at 6:42 am
Cheers Frank......Basically the VB app is going to be a UI for the database.....does this make a difference to any methods ill need?
quote:
Hi Andrew,quote:
Im fairly new to SQL Server but wish to create an application in VB (6.0) with a small SQL Server DB back end. Is this possible and easy to do?welcome back
Getting a basic app skeleton using VB6 isn't really difficult.
I think depending on your VB edition, you can choose from File-> New project the entry 'Data project'. VB add automatically references to ADO and to ADO controls. That's a basic start, but using ADO with VB is very well documented.
However, be prepared to hand code more than say in Access.
And the reporting engine in VB isn't by far that brilliant as Access Report Generator.
And, as always, if you got any questions, come back and ask.
Frank
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
October 20, 2003 at 6:44 am
quote:
Cheers Frank......Basically the VB app is going to be a UI for the database.....does this make a difference to any methods ill need?
Nope, that's the main purposes and strength of VB compared to VC++
Frank
Edited by - Frank Kalis on 10/20/2003 06:53:29 AM
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
October 21, 2003 at 2:08 am
Hai Andrew,
You can connect from VB to SQL Server is the following ways:
1. Using ADO's
2. Using SQL-DMO
I'm giving a sample code related to ADO's
Code:
-----
Const gCnnStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=" & <DataBaseName> & ";Data Source=" & <ServerName>
Dim AdoRs As New ADODB.Recordset
Dim AdoCn As New ADODB.Connection
'Connection establishment.
With AdoCn
If .State = adStateOpen Then .Close
.CursorLocation = adUseClient
.Open gCnnStr
End With
'Note: In the above connection string provide the Database Name, Server Name.
The above code is simplest way to connect SQL server using VB 6.0
If you have queries, ask me.
Bye...!
October 21, 2003 at 3:58 am
hi!
concerning the example: don't forget to use "tools/references" to add the ADO interfaces to your project (MDAC - available from microsoft as "MDAC_TYP.exe" in thousands of variants and installed by a whole bunch of programs silently in equally a thousand versions).
make sure you choose a version that will exist on your clients, otherwise your EXE will fail (this is all about COM). as a baseline, i'd suggest using "ActiveX Data Object Library 2.5" (may don't be the exact wording), a version below 2.5 shouldn't be used anyway, just too old.
best regards,
chris.
October 21, 2003 at 4:30 am
Thanks guys..Im sure ill come back very soon for some more advice!
Cheers
quote:
hi!concerning the example: don't forget to use "tools/references" to add the ADO interfaces to your project (MDAC - available from microsoft as "MDAC_TYP.exe" in thousands of variants and installed by a whole bunch of programs silently in equally a thousand versions).
make sure you choose a version that will exist on your clients, otherwise your EXE will fail (this is all about COM). as a baseline, i'd suggest using "ActiveX Data Object Library 2.5" (may don't be the exact wording), a version below 2.5 shouldn't be used anyway, just too old.
best regards,
chris.
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
October 21, 2003 at 8:35 am
Eagles fly. Turkeys skydive.
October 29, 2003 at 5:10 am
Only skydivers know why birds sing.........
quote:
Eagles fly. Turkeys skydive.
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
November 10, 2003 at 5:51 am
Did you reference Microsoft ActiveX DataObjects in your project?
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
November 10, 2003 at 6:30 am
Its fine now.........just a stupid mistake
Cheers Frank
quote:
Did you reference Microsoft ActiveX DataObjects in your project?Frank
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
If riding in a plane is flying, then riding in a boat must be swimming. To experience the element, get out of the vehicle. Skydive!
November 11, 2003 at 7:10 am
quote:
Eagles fly. Turkeys skydive.
Yeh. It's hard to fly like an Eagle when you work with Turkeys.
Edited by - davidburrows on 11/11/2003 07:11:16 AM
Far away is close at hand in the images of elsewhere.
Anon.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply