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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database - create and updating

Status
Not open for further replies.

allis

Technical User
Oct 16, 2002
11
0
0
US
I created a program, and along with it a database that users will be using - adding their own records, deleting, updating, etc.

Now, since I used VB to creat the database on MY computer, how then do I get the database to their computer - simply copy a blank copy of the database to their computer and change the path - so the program will work or is there an easier way?

Also, I created this program in VB 6.0 working model edition, and need to make it an executable file - how do I achieve this?

Also, I have user errors I'd like to protect against - they need to fill the record information in the text boxes before pressing "ADD" button to add the record.

How do I prevent the error of pressing "ADD" and then typing the record?

Also, how do I code for the situation if they press "Search" while the database is empty?

Thanks
 
Those are all pretty general questions. To be honest, and I apologize if this sounds "elitist", it sounds like you need a programmer (I notice that you are listed as a technical user). I know VB is easy, but you're asking questions about basic programming stuff - error handling, input validation, datasources, etc. That's not to say that you can't do it - I think everyone can do whatever they really set their mind to. It just sounds like you're starting down the programming road and, if you're going to do that (which I think is pretty cool), then it would be wise to go ahead and enroll in a class for it or buy some books for beginning programmers. Again, I am not saying this to be uncool or condescending - it's just the stuff you're asking has that kind of scope so unless somebody here just has a LOT of time you're probably not going to get much in the way of answers here. People tend to answer the more specific questions more.

Having said that, I can answer one of your more specific questions - that of the "ADD" button. VB buttons have a property called "Enabled". When this value is set to "true", you can click it. When it is set to "false", you can't click the button. You would have to couple that with other code - namely, code to determine which way it should be set - to do what you are looking for. You can handle the "SEARCH" button similarly, though as to that I'd just recommend handling the situation of a search returning no values rather than prevent them from searching in the first place.
 
All your questions have answers!
1. Making the database available to others over the network: If I understand you correctly (forgive me if I got the wrong idea) you can leave the database on your workstation, put it in a shared folder, and have other users on the network browse to that folder, then with the right mouse button, drag a shortcut onto their desktop for easy access.
2. To make it executable, in the VB IDE (your development environment) open File, then click "Make yourProgram.exe"
3. If I understand the other question correctly, use statements like:
If txtBox.Text <> &quot;&quot; Then 'make sure they have put in
'something into the textbox
4. To end the sub if the database is empty:
If rec.EOF And rec.BOF Then
'message box message here
Exit sub

Hope this helps!

'your other code here
End If


--Bill
One may not reach the dawn save by the path of the night
--Kahlil Gibran
 
My end of my text got jumbled somehow. I hope you understand that the 'End If' and &quot;other code here&quot; goes up there with the If stuff! Jeez. How did that happen? :eek:)Whatever.

--Bill
One may not reach the dawn save by the path of the night
--Kahlil Gibran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top