Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

SQL query will not return any records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary - 21 Nov 2005 13:25 GMT
I have the following code to retrieve records from an access table in another
database. If I run a query using a linked table it returns all records as
expected. How ever with the sql I have below I recieve the error message 'No
Current Record' when .MoveFirst is executed, i.e. recordset is empty. Do I
need to change my openrecordset settings?

Set wrkJet = CreateWorkspace("wrkjet", "admin", "", dbUseJet)
       
   Workspaces.Append wrkJet
         
   cn1 = "provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=\\ugsvr01\techdocs\Drawing Modifications\X_be.mdb;" & _
        "Persist Security Info=False"

   Set dbAcc = wrkJet.OpenDatabase("X_be.mdb", , , cn1)
   
   MYSQL = "SELECT Contacts.Person " & _
           "FROM Contacts " & _
           "WHERE Contacts![Fourman ID]= '" & DrwBy & "' "
           
   Set rs1 = dbAcc.OpenRecordset(MYSQL, dbOpenSnapshot, dbSQLPassThrough,
dbReadOnly)
     
       
   With rs1
  .MoveFirst
  'Do Until .EOF
 
   Forms![frmRFC]![DrawnBy] = rs1.Fields("Person")
       
   End With
Chris2 - 21 Nov 2005 22:55 GMT
> I have the following code to retrieve records from an access table in another
> database. If I run a query using a linked table it returns all records as
[quoted text clipped - 26 lines]
>
>     End With

Gary,

Please post all variable declarations involved in this code
segement, as well as all object SETs involved.

Sincerely,

Chris O.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.