Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / November 2005



Tip: Looking for answers? Try searching our database.

How do I access data in a field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan - 30 Nov 2005 03:19 GMT
Hi -

Does anyone know how I set a reference to a given field of an Access table
through code when I know the string value of the table?  I would think it
would involve the "SET" statement but can't figure it out.  I set up a
standard connection and open the recordset using:

   MyRS.Open "SELECT * FROM myTable;", myConn

The table names will be variables and passed to the sub, so I need to access
them knowing their names.

Thanks a lot for any help!

Dan
Earl - 30 Nov 2005 05:40 GMT
You mean something like:

"SELECT " & mystrColName & "FROM myTable"

> Hi -
>
[quoted text clipped - 12 lines]
>
> Dan
MP - 30 Nov 2005 05:54 GMT
since he said...
>> through code when I know the string value of the table

I thought he meant something like
(assuming sTableName is the name of the table which I think he means by
"string value of the table")

MyRS.Open "SELECT * FROM " & sTableName, myConn

but that's just my newbie guess.
:-)
Mark

> You mean something like:
>
> "SELECT " & mystrColName & "FROM myTable"

> > Hi -
> >
> > Does anyone know how I set a reference to a given field of an Access table
> > through code when I know the string value of the table?  > > Dan
Earl - 30 Nov 2005 06:49 GMT
No, I was just sleeping ... now he knows both anyway.

> since he said...
>>> through code when I know the string value of the table
[quoted text clipped - 18 lines]
> table
>> > through code when I know the string value of the table?  > > Dan
 
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



©2009 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.