By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,578 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,578 IT Pros & Developers. It's quick & easy.

Binding combo box

P: n/a
TS
I configured a data adapter and generated a dataset to access data
coming from an SQL database table when my form loads. After the form loads
nothing is populated in the combo box that supposed to be bound to a column
in the database table. Someone in this newsgroup thankfully told that I still
have to write some codes to populate the combo box with data. Here is the
code he sent me and that I tried on my application. The codes return the
following error message: "Unhandled Exception:
System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was done". Can
someone please tell me how to make this code work?

Dim strConn As String

Dim strSQL As String

Dim SscIntake1 As New DataSet()

Dim da As OleDb.OleDbDataAdapter

Dim conn As OleDb.OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"

conn = New OleDb.OleDbConnection(strConn)

da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn)

da.Fill(SscIntake1, "qmf_cint")

ComboBox1.DataSource = SscIntake1.Tables("qmf_cint")

ComboBox1.DisplayMember = "Last_Name"
--
TS
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Your connection string is wrong

strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"
Here is an example
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn &= "Data Source = C:\Northwind.mdb;"

Ken

-------------------------

"TS" <TS@discussions.microsoft.com> wrote in message
news:CE**********************************@microsof t.com...
I configured a data adapter and generated a dataset to access data
coming from an SQL database table when my form loads. After the form loads
nothing is populated in the combo box that supposed to be bound to a column
in the database table. Someone in this newsgroup thankfully told that I
still
have to write some codes to populate the combo box with data. Here is the
code he sent me and that I tried on my application. The codes return the
following error message: "Unhandled Exception:
System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was done". Can
someone please tell me how to make this code work?

Dim strConn As String

Dim strSQL As String

Dim SscIntake1 As New DataSet()

Dim da As OleDb.OleDbDataAdapter

Dim conn As OleDb.OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"

conn = New OleDb.OleDbConnection(strConn)

da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn)

da.Fill(SscIntake1, "qmf_cint")

ComboBox1.DataSource = SscIntake1.Tables("qmf_cint")

ComboBox1.DisplayMember = "Last_Name"
--
TS
Nov 21 '05 #2

P: n/a
TS
Thanks, but I'm getting confused now. The server where the SQL database
resides is USEGNYDC3\CLIENT_DB and the database name is SSC.
I tried the following connection string:
strConn &= "Data Source = \\USEGNYDC3\CLIENT_DB\SSC.mdb;" and got an error
message. What should the connection string be then?
"Ken Tucker [MVP]" wrote:
Hi,

Your connection string is wrong

strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"
Here is an example
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn &= "Data Source = C:\Northwind.mdb;"

Ken

-------------------------

"TS" <TS@discussions.microsoft.com> wrote in message
news:CE**********************************@microsof t.com...
I configured a data adapter and generated a dataset to access data
coming from an SQL database table when my form loads. After the form loads
nothing is populated in the combo box that supposed to be bound to a column
in the database table. Someone in this newsgroup thankfully told that I
still
have to write some codes to populate the combo box with data. Here is the
code he sent me and that I tried on my application. The codes return the
following error message: "Unhandled Exception:
System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated
errors. Check each OLE DB status value, if available. No work was done". Can
someone please tell me how to make this code work?

Dim strConn As String

Dim strSQL As String

Dim SscIntake1 As New DataSet()

Dim da As OleDb.OleDbDataAdapter

Dim conn As OleDb.OleDbConnection

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source = Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxx;database=SSC;server=zzz;"

conn = New OleDb.OleDbConnection(strConn)

da = New OleDb.OleDbDataAdapter("Select * From qmf_cint", conn)

da.Fill(SscIntake1, "qmf_cint")

ComboBox1.DataSource = SscIntake1.Tables("qmf_cint")

ComboBox1.DisplayMember = "Last_Name"
--
TS

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.