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 / SQL Server / ADP / November 2005

Tip: Looking for answers? Try searching our database.

SQL Query in .ADP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
phil1bruening@web.de - 08 Nov 2005 19:58 GMT
Hi,

how can i make a simple Select Query with VB in Access (.adp)?

Thanx a lot
aaron.kempf@gmail.com - 08 Nov 2005 21:51 GMT
you make a view
Andrea M - 09 Nov 2005 05:09 GMT
The format is the same as you would use if you were working with an Access
.mdb file:

SELECT field_name1, field_name2 FROM table_name;

You can add criteria:
SELECT field_name1, field_name2 FROM table_name WHERE field_name1 = 3;

I'm not sure if this was the information you needed.  If you need more
specific information about working with recordsets in ADO, you would need to:

DIM rec as new adodb.recordset
DIM strSQL as string

strSQL = "SELECT field_name1, field_name2 FROM table_name;"
rec.open strSQL, currentproject.connection, adOpenKeySet, adLockOptimistic

ADO recordsets work a bit differnently than DAO so you can poke around on
the Microsoft Developer Network where there are many articles you can search
through for information:
http://msdn.microsoft.com/default.aspx

If you are used to working with .mdb files the link below gives a brief
translation from DAO to ADO for some things.  (Though it doesn't cover how
some of the record navigation works differently too.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/ac
howDAOToADO_HV05267115.asp


Hope that helps.

Signature

Andrea

Andrea M - 09 Nov 2005 16:32 GMT
One other tip is that you can let Access help you with the syntax fot a
SELECT statement.  Just build a query, stored proceedure, or a view with the
wizard and then switch it to SQL view.  Copy and paste the code.
Signature

Andrea

 
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.