I am used to ASP and ttry to do a little thing in VBA
I´ve tried a cople of examples but I get errors all the time when trying to populate a combobox in a form with a recordset from a database.
What is wrong here?
Thanks//Martin

Private Sub Bygglinjer_Click()
' OLE DB provider for the RDMS (Oracle = MSDAORA)
strProvider = "MSDAORA"
' Name of the server running RDMS
strServer = "karta"
' RDMS loggin to use
strUser = "xxxx"
strPWD = "xxxx"
'Option Explicit
Dim cn As New ADODB.Connection
Dim rs As New ADODB.RecordSet

Dim SQL As String
Dim frmA As New UserForm1

cn.Open "Provider=" + strProvider + ";Data Source=" + strServer + ";User ID=" + strUser + ";Password=" + strPWD

SQL = "SELECT [ACADLAYER] FROM [FASTL] ORDER BY [ACADLAYER]"
rs.Open SQL, cn

With rs
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.Open SQL, cn, adCmdTable
End With

'Adding data to Combobox
Do Until rs.EOF
frmA.ComboBox1.AddItem rs![ACADLAYER]
rs.MoveNext
Loop
rs.Close
cn.Close
frmA.Show


End Sub