|
-
May 20th, 2003, 04:37 PM
#1
Thread Starter
Junior Member
Trouble with SQLConn string
Can any one tell me what the connection string for a SQL connection should be for :--
Dim dbconn As New SqlConnection _("DataSource=C:\PROJECTS\GraphicsProject.mdb")
I am working on a standalone computer and do not know the exact name of the sql server. Do I need this and if so, how do i find it ?
Thanks a million.
-
May 20th, 2003, 04:43 PM
#2
Frenzied Member
I think you need an OleDB connection instead of SqlConnection.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 20th, 2003, 04:58 PM
#3
Sleep mode
Here it's highlighted in red . http://www.sitepoint.com/article/1005/2 too lazy to copy it here . lol
-
May 20th, 2003, 05:10 PM
#4
Thread Starter
Junior Member
Thanks for your replies.
I have decided to go with OledbConn object for now.
I am using it for access database so I am not sure if SQLConn works there. I have a problem with oleDBDataAdapter though..when I use its fill method I keep getting this error :
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
This was the reason why I thought of switching to SQLConnection.
Appreciate your help.
-
May 20th, 2003, 05:14 PM
#5
Sleep mode
This is what I always use . If your database isn't password-protected then leave MyPassword variable set to Nothing otherwise , you can type it there .
VB Code:
Public Shared MyPath As String = Application.StartupPath & "\AppDb.mdb"
Public Shared MyPassword As String = Nothing
Public Shared MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyPath & ";Jet OLEDB:Database Password=" & MyPassword)
-
May 20th, 2003, 05:17 PM
#6
Sleep mode
aah , I hate this . Just replace that laughing face with : and D letter .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|