dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
With cn
.ConnectionString = "PROVIDER=SQLOLEDB;" & _
"DATA SOURCE=sever;" & _
"USER ID=sa;" & _
"PASSWORD=dimu;" & _
"INITIAL CATALOG=base"
.Open
End With
With rs
.CursorLocation = adUseClient '
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.ActiveConnection = cn
.Open "SELECT * FROM table"
End With
Me.Report.RecordSource = rs
j'arrive pas à affecter une table "Clients" qui est sur sql server et qui est protège avec mot de passe a un recordsource d'un report
Google translation: I manage not to affect(allocate) a table "Customers" which(who) is on sql server and which(who) is protect with password has a recordsource of an adjournment(transfer)
NB: le même code marche avec me.form.recordsource = rs
Google translation: NB: the same code walks(works) with me.form.recordsource = rs