Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6.0 Retrieve a field value from Access 2000 and store in registry? 1

Status
Not open for further replies.

fugly

Technical User
Mar 21, 2002
29
US
I want to retieve a field value from an SQLPass through query from an Access 2000 database and the store the returned value in the registry. Without the user seeing it happen and with no user input. I can upon access, open query, but how do i pull one value from the query and store it in the reg.?

database = database.mdb
Query and field Get_Doc.doc_lname

 
Check in VBhelp and/or MSDN for SaveSettings and GetSettings Let me know if this helps

Check out FAQ222-2244
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
I am alreadying using the save/get setting lines. I want to only return one value from a query in Access. Much like the registry, but using a database query instead of the registry. Anymore thoughts?
 
What query are you using at present? Is it returning multiple values?

Did you check out the FAQ referred below? Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
OK here's the deal. I am about to distribute an app. I would like to protect it abit from thieves. The access database will already have the user's last name as well as other data in the database. I am currently using a make table SQL command from my visual basic 6.0 app to retieve the data from an SQL pass thru query. The problem lies that there may (or may not) be multiple names in the table. I would like to have the app, open access get the information and check it against the hard coded value stored in the program, and not the registry as it could be visualized with regedit. But how do you return a value from a table in access into a string variable in the VB app to compare against another string variable?
 
Declare a constant for hardcoded name
Code:
Public Const FixedName As String = "Smith"

After you've opened your connection etc.
Code:
Dim mySuccess as Boolean
mySuccess = False
mySQL = "Select lastname from tblNames"
rst.Open mySQL
Do While Not rst.EOF
If rst.lastname = FixedName Then mySuccess = True
rst.MoveNext
Loop

Is this what you're looking for? Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
The idea you presented worked well thanks....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top