Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


VB & SQL - Verify Password stored in SQL from VB and show that particular record of that password in VB Form.

Posted on 2003-03-19
Medium Priority
Last Modified: 2013-12-25
I need my visual basic application to show me the record of a specified ID or password stored in SQL...
I can connect and view the files and so on.... but i cant seem to specify the record that i want to view...
For example... I need to type in the ID which is 99999 in visual basic...
Then it must look up in SQL for that ID and show me the record for that ID only....
If possible, I should edit, or delete the record....

I am using VB6 and MS SQL 7...
I really need the code in visual basic to complete my task...

Hope you can HELP ME
Thank You So Much...

Question by:icefx
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8165932
you have to use Privileges in your database.
you can declear userid as public in ur Module and check it in all forms.As it is decleared as public it will be available in all forms.
 then on form_load you can check for userid and can display replated records for that USER_ID.
 public useid as String.

in form :
 if userid = "999999" then
    Display records those you want to get from database.
 end if


Accepted Solution

Ysgrathe earned 120 total points
ID: 8165934
have you tried running a query that filters for the record id? I am assuming you are not very familiar with MS-SQL so i will avoid stored procedures for the moment.

simply do a
'SELECT * from tblMyTable where MyID=99999'

personally i would not allow editing of the record set returned.

i would let the users edit the results on the form, and when done they would hit the update button and it would execute the equivalent of a
'UPDATE tblMyTable set field1=value1,field2=value2, etc
WHERE MyID=99999'

and i would do a similar approach for a delete record.

Expert Comment

ID: 9095617
No comment has been added lately (141 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to Ysgrathe http:#8165934

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --


EE Cleanup Volunteer

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

722 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