Re: ADODB Recordset and Connection
- From: Piper <Piper@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Jun 2007 09:38:39 -0700
Thank you - the error is gone and it sort of works :)
I think I'm kind of getting the hang of it
--
Piper
"roger" wrote:
"Piper" <Piper@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message.
news:FA68CB1C-1B5F-4F00-A891-A31F4C303250@xxxxxxxxxxxxxxxx
Ok I'm getting smarter, so I think, but it still dosent work!
Sub createListBX()Phones."
Dim noPh As String, qry As String
Dim cpFrm As Form
Dim rcdSet As New ADODB.Recordset
noPh = getNme(Forms!Emp_Form!Emp_ID) + " has no Dept Issued Cell
qry = cpByIDQry(Forms!Emp_Form!Emp_ID)
Set rcdSet = setRcdSet(rcdSet, qry)
If rcdSet.EOF = True & rcdSet.BOF = True _
Then
That should be "AND" not "&"...
If rcdSet.EOF = True AND rcdSet.BOF = True _
Then
Function setRcdSet(rcdSet As ADODB.Recordset, query As String) _
As ADODB.Recordset
Set rcdSet = New ADODB.Recordset
I don't think you need the line above. You already have...
"Dim rcdSet As New ADODB.Recordset"
in the first procedure.
rcdSet.Open query, setCnxn, adOpenDynamic, adLockOptimistic, adCmdText
Set setRcdSet = rcdSet
End Function
Function setCnxn() As ADODB.Connection
On Error GoTo ErrorHandler
Get rid of the line above, until the code is working
Dim cnxnStr As String
Here you need...
Dim Cnxn As ADODB.Connection
cnxnStr = "Driver={Microsoft Access Driver " _
& "(*.mdb)};Dbq=U:\PersonnelDB\CC_Personnel.mdb;"
Cnxn = New ADODB.Connection
That should be...
Set Cnxn = New ADODB.Connection
Cnxn.CursorLocation = adUseServer
Cnxn.Open cnxnStr
Set setCnxn = Cnxn
****************
End Function
--
roger
- References:
- ADODB Recordset and Connection
- From: Piper
- RE: ADODB Recordset and Connection
- From: Piper
- Re: ADODB Recordset and Connection
- From: roger
- ADODB Recordset and Connection
- Prev by Date: Re: Adox Views in Access97
- Next by Date: RE: Inserted Identity Values in SQL 2005
- Previous by thread: Re: ADODB Recordset and Connection
- Next by thread: adodb and active directory
- Index(es):
Relevant Pages
|
|