What do you mean strCode is in the combo (do you mean it is a property that you want to display)? DisplayMember isn't how you get the SelectedItem of the combobox if that is what you are trying to do.
It is a value in the combo box that I want to be highlighted on the combo?
Dim cmdText As String
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i As Integer
Dim strTest As String
con.Open("Driver={SQL Server};Server=..........")
cmdText = "Select * from ........."
rs.Open(cmdText, con)
i = 0
While Not rs.EOF...
It is in a with block and the error message is:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in adodb.dll
Additional information: Item cannot be found in the collection corresponding to the requested name or ordinal.
I am receiveing an error on this line of my code,
If Not IsDBNull(CStr(rs.Fields("a_date").Value)) Then
.Items(i).SubItems.Add(CStr(rs.Fields("a_date").Value))
End If
Any ideas?
I have had the same problem and I used a formula such as:
If Instr(1,cstr({field1}),".") > 0 Then
formula = left(Totext({field1}),len(Totext({field1})) - 3)
End if
to get rid of the decimal places. However, when you have more numbers (grouped) e.g. 101, 6 the numbers do not sort properly...
I am connecting to an Oracle database using a connebction string. However, I am getting the error
Run time error '-2147217871 (80040e31)'
[Oracle][ODBC][Ora]ORA-01013: user requested cancel of current operation.
My connection string is
Set con = CreateObject("ADODB.Connection")
Set rs =...
I have a 3 part DB naming convention such as
DB1.dbo.client
Is there any way to make the first part into a variable such as;
DECLARE @DB as varchar(20)
SET @DB = 'DB1'
SELECT * FROM @DB + '.dbo.client'
Any help would be appreciated
Missing the Columns
Set con = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
con.Open "Driver={SQL Server};Server=Server;Database=Database;Uid=USERID;Pwd=Password;"
If rs.EOF = False Then
'get field headings from db
For i = 0 To...
I have created an ADODB connection to a sql server 2000 database. However, when I use the copyfromrecordset command I don't get all the data back.
The field which the command doesn't like is a field declared as text with a length of 16.
Is there any other way I could get the data?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.