|
-
Jun 3rd, 2005, 02:30 PM
#1
Thread Starter
Member
combo box nightmares
hi
I have a combo box that pulls the data from a look up table present in the SQL server.
I am getting this weird error
"string or binary data would be truncated"
This only happens when the drop down list has strings like
"voice_and_data"
"handset_in_closet"
Can some one please help
The code is
Private Sub load_cmbMbl()
Dim conSQL As ADODB.Connection
'Sets connection
Set conSQL = New ADODB.Connection
Dim strSQLServer As String
Dim strSQLDatabaseToOpen As String
Dim strConnectString As String
Dim strSQL2 As String
strSQLServer = "sfdaqsql1"
strSQLDatabaseToOpen = "techlog_copy"
strConnectString = "Provider=sqloledb;" & _
"Integrated Security=SSPI;" & _
"Data Source=" & strSQLServer & ";" & _
"Initial Catalog=" & strSQLDatabaseToOpen & ";"
conSQL.Open (strConnectString)
cmbMbl.Clear
Dim rsRecords As ADODB.Recordset
Set rsRecords = New ADODB.Recordset
strSQL2 = "SELECT mobile_test FROM Mobile_Test_Lookup"
rsRecords.Open strSQL2, conSQL
If Not (rsRecords.BOF And rsRecords.EOF) Then
rsRecords.MoveFirst
Do
cmbMbl.AddItem rsRecords.Fields
rsRecords.MoveNext
Loop Until rsRecords.EOF
End If
rsRecords.Close
Set rsRecords = Nothing
conSQL.Close
End Sub
Please help
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
|