Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Invalid connection

Author  Topic 

ronin2307
Posting Yak Master

126 Posts

Posted - 2005-03-16 : 12:31:43
Hi,

I am new to SQL connections and I am stuck with this error message:

[DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.

what am I doing wrong?



Dim DS As DataSet
Dim MyCommand As OleDb.OleDbDataAdapter
Dim MyConnection As OleDb.OleDbConnection

MyConnection = New OleDb.OleDbConnection( _
"Provider=sqloledb;Data Source=V:\mssql2000\MSSQL\Data\DATA06_Data.mdf;Ini tial Catalog=some_table;User Id=sa;Password=xxxxx;")
' Select the data from Sheet1 of the workbook.
MyCommand = New OleDb.OleDbDataAdapter("select * from [some_table]", MyConnection)

DS = New DataSet
Try
MyCommand.Fill(DS)
Catch ex As Exception
TextBox1.Text = ex.Message
End Try
MyConnection.Close()

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 12:49:41
well then this site should be you best friend:
http://www.connectionstrings.com/

Go with the flow & have fun! Else fight the flow
Go to Top of Page

ronin2307
Posting Yak Master

126 Posts

Posted - 2005-03-16 : 12:51:16
that is where I got the connection string from :-)

I just filled out my data source and user info
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 12:59:47
maybe you should loose the spaces in

Ini tial Catalog


Go with the flow & have fun! Else fight the flow
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-03-16 : 13:00:26
Want to try my Best Friend Connection site instead then?

http://www.able-consulting.com/ADO_Conn.htm

Shouldn't "initial catalogue" be SomeDATABASE rather than SomeTable ??

Kristen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-16 : 13:03:17
and don't use SA account


Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -