PC Review


Reply
Thread Tools Rate Thread

Binding combo box

 
 
=?Utf-8?B?VFM=?=
Guest
Posts: n/a
 
      5th Apr 2005
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
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      5th Apr 2005
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" <(E-Mail Removed)> wrote in message
news:CEA16F67-E2B6-4780-9F01-(E-Mail Removed)...
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


 
Reply With Quote
 
=?Utf-8?B?VFM=?=
Guest
Posts: n/a
 
      6th Apr 2005
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" <(E-Mail Removed)> wrote in message
> news:CEA16F67-E2B6-4780-9F01-(E-Mail Removed)...
> 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box Binding Gajanan Microsoft Access Form Coding 1 17th Dec 2007 05:49 AM
Binding a Combo Box pcstechnical.sfhs@gmail.com Microsoft Access Forms 5 25th Sep 2007 08:26 PM
binding to Combo Rod Microsoft Dot NET 4 24th Feb 2005 03:50 PM
binding to a combo box Geraldine Hobley Microsoft VB .NET 1 22nd Dec 2003 03:59 PM
binding to a combo box Robert Batt Microsoft Dot NET Framework Forms 0 21st Oct 2003 02:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:51 AM.