Hi,
Which Reference Library should I select for ADO commands please?? I'm using code below in reference the answer from the link:
https://access-programmers.co.uk/forums/showthread.php?t=230610#post1176746
...and is there any advantage of using ADO (which i don't know anything about yet) vs DAO??
Thanks & Regards,
K
Dim adoCMD, adoRS, Conn As Object
Dim strSQL As String
Set Conn = CreateObject("ADODB.Connection")
Conn.Open ("DSN=****;Uid=****;Pwd=****;DATABASE=****")
strSQL = "SELECT * FROM tblBoQ_Progress WHERE BoQID = P1"
'Define attachment to database table specifics
Set adoCMD = CreateObject("ADODB.Command")
Set adoCMD.activeconnection = Conn
With adoCMD
.activeconnection = CurrentProject.Connection
.commandtype = accmdtext
.Parameters.Append .createParameter("P1", adVarChar, adParamInput, 25, Me.ID)
.commandtext = strSQL
Set adoRS = .Execute()
End With
Which Reference Library should I select for ADO commands please?? I'm using code below in reference the answer from the link:
https://access-programmers.co.uk/forums/showthread.php?t=230610#post1176746
...and is there any advantage of using ADO (which i don't know anything about yet) vs DAO??
Thanks & Regards,
K
Dim adoCMD, adoRS, Conn As Object
Dim strSQL As String
Set Conn = CreateObject("ADODB.Connection")
Conn.Open ("DSN=****;Uid=****;Pwd=****;DATABASE=****")
strSQL = "SELECT * FROM tblBoQ_Progress WHERE BoQID = P1"
'Define attachment to database table specifics
Set adoCMD = CreateObject("ADODB.Command")
Set adoCMD.activeconnection = Conn
With adoCMD
.activeconnection = CurrentProject.Connection
.commandtype = accmdtext
.Parameters.Append .createParameter("P1", adVarChar, adParamInput, 25, Me.ID)
.commandtext = strSQL
Set adoRS = .Execute()
End With
Last edited: