Solved

database fields

Posted on 2000-02-21
3
127 Views
Last Modified: 2010-05-02
how can i make reference to a field in a database ?;for example.
I want to compare the actual date with the one that is stored on the field DATE of my table.I am using a dbf table.
0
Comment
Question by:enryo
3 Comments
 
LVL 9

Accepted Solution

by:
samopal earned 70 total points
Comment Utility
You have many ways to do this....

For example, in ADO

Dim cn as new ADODB.Connection
Dim rs as new ADODB.Recordset

'First you need to create yourDSN (Control Panel -> ODBC Data Sources)
cn.open "DSN=yourDSN"
rs.open "myTableName",cn

rs.fields(1)
rs(1)
rs.fields("myField")
rs("myfield")
rs!myfield

-all this gives your the refference to the 2nd field in your table named myfield

HTH
0
 

Author Comment

by:enryo
Comment Utility
I want to access the table with Data Control
0
 
LVL 2

Expert Comment

by:danlevans
Comment Utility
enryo,

data1.recordset!myfield

contains the data in myfield of the current record in your database using data control.

have fun,

Dan
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now