Hi,

The following code is use ADODB to connect the database. By this way I would like to change the following coding by using "OleDbConnection", how can I change it?

RstBoa = New ADODB.Recordset
BoaSQL = "Select * From QtyVar ORDER BY QtyVarID"
RstBoa = ConnBoa.Execute(BoaSQL)
With RstBoa
If Not .EOF Then
Do While Not .EOF
'Retrieve Quantity Variance
CboVar.Items.Add(RstBoa("QtyVar").Value)
RstBoa.MoveNext()
Loop
End If
.Close()
End With
ConnBoa.Close()
RstBoa = Nothing
ConnBoa = Nothing

Hi,

You need to specify OLEDB in your connection string.

Here's Microsoft's native OLE DB provider:

Public Const ORACLE_MS_OLEDB_CONNECT As String = "Provider=msdaora; Data Source="

That's for connecting to Oracle. The best source for connection strings is:

http://www.connectionstrings.com/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.