Important alert: (current site time 7/16/2013 3:55:25 AM EDT)
 

winzip icon

Creating Database Applications For the Beginners-2

Email
Submitted on: 12/5/1999
By: smozgur 
Level: Beginner
User Rating: By 4 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0, VB Script, ASP (Active Server Pages)
Views: 33241
(About the author)
 
     Second code for managing database series. Querying with SQL and basic dictionary application. Enjoy it.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

12/5/1999 3:48:00 PMIan Costrik

Hello, Thank you for this VERY VERY helpful piece
of code!!
I think you're doing a very great job of helping out the folks
who are new to database programming in visual basic
and i commend you :)

i was just wondering though,
could you (whenever you have the chance), make a step-by-step
tutorial (perhaps?) on how to build a database application from scratch?
that implements the following features:
fast search through the database, insert, delete, update, edit?

Thanks! :)
and VERY VERY great job!

Ian
(If this comment was disrespectful, please report it.)

 
12/5/1999 5:41:00 PMSteve

The code looks good, from the little experience I have with databases, however the database file you included seems to be corrupted or perhaps incorrect. I am not sure which. I am going to try downloading it again though. Thanks for the upload. It's very cool how your helping out a lot of people with databases.
(If this comment was disrespectful, please report it.)

 
12/6/1999 6:55:00 PMoc

First i would like to say thanks for your help & time

?? about this line

SQLText = "SELECT * FROM DBWords WHERE Left(dbWord," & Len(reqText) & ")='" & reqText & "';"

can you expline a bit more of what it is doing

i think i can under stand it up to about here

SQLText = "SELECT * FROM DBWords WHERE Left(dbWord," & Len

thanks
oc
(If this comment was disrespectful, please report it.)

 
12/9/1999 11:24:00 AMahmed

i wanna more examples
(If this comment was disrespectful, please report it.)

 
12/12/1999 6:09:37 AMmunro

Great, someone who can help on the creating databases within VB. Thanks. It's just what I've been looking for, but can you please explain

SQLText = "SELECT * FROM DBWords WHERE Left(dbWord," & Len(reqText) &
")='" & reqText & "';"

thanks again.
(If this comment was disrespectful, please report it.)

 
12/14/1999 9:53:04 AMEelco

This code is soooo great!!

Just what i have been looking for for a LONG time!

When do you post your next example?
(If this comment was disrespectful, please report it.)

 
12/20/1999 5:32:46 PMoc

just like to say thanks for your email Suat it helped, still not to sure about the last bit of the line.
(If this comment was disrespectful, please report it.)

 
1/3/2000 5:58:16 PMTim S.

The code looks good but I have some mild criticism. In the declaration section of the module the variables DBMain and RecSet are declared as Global. I have a pet peeve about your incosistent use of the Microsoft Naming convention which would require your global variables to be prefaced with "g" and your forms to start with "frm", but for the sake of this tutorial it is acceptable. However do you think creating database connections globally without closing them right after use is the best method? I'd like to see some debate about this. I personally try to open, exucute and close database connections all in one function. My thinking was that database connections are limited.
(If this comment was disrespectful, please report it.)

 
1/13/2000 12:47:04 PManon

Interesting DB code If Programming were Music ....Youd be a Hendrix of code
(If this comment was disrespectful, please report it.)

 
1/25/2000 11:13:18 AMsibel bektas

thank you for your good idea ,i need examples visual basic database with sql
and add remove or other commadnd ,can you help me for my project ? ..
(If this comment was disrespectful, please report it.)

 
1/26/2000 12:01:22 AMARRiVE

SELECT * FROM EmployeeTable ......

* being all the rows in the record set otherwise say you only want first names.... SELECT FName FROM EmployeeTable
Get it now?

ARRiVE
(If this comment was disrespectful, please report it.)

 
1/26/2000 7:40:13 AMGord

My thoughts on the database connections issue...
I think that keeping the connection open will improve performance. I also think that connections to a database only become an issue in medium size and up multi-user apps or when you are dealing with a database back-end that has connection licences (SQL Server, Oracle, ...).

That's my 2 cents :)

(If this comment was disrespectful, please report it.)

 
1/26/2000 8:26:12 AMEugene Almanon

I saw that this is great like us (beginners) even the advances Programmers cause every one has different style and thinking. I want you to be my mentor in Database Programming. I want to dedicate my carrer in this field. How can I contact you aside from here.

Thank you.

eugene
(If this comment was disrespectful, please report it.)

 
1/26/2000 8:50:24 AMSam

Great stuff!
However, I think the following line should be changed for speed

From:
'SQLText = "SELECT * FROM DBWords WHERE Left(dbWord," & Len(reqText) & ")='" & reqText & "';"

To:
SQLText = "SELECT * FROM DBWords WHERE dbWord like '" & reqText & "*';"

In a case of a real dictionary where you have many words, using left would be very costly. The reason is that when you use left, the query returns all rows and the the JET engine filters out the unneeded ones. When you use LIKE, the query will nver return the unneeded rows.

If I am wrong please let me know.

Once again, Thanks for the code.
(If this comment was disrespectful, please report it.)

 
2/9/2000 9:00:04 PMNady

Thanks for help
(If this comment was disrespectful, please report it.)

 
2/24/2000 1:17:17 PMAmNeStY

Does any one know if there are going to be more codes from this man
GREAT CODE DUDE
but I am searching after a code to delete,rename, etc.
Pleas help
(If this comment was disrespectful, please report it.)

 
2/28/2000 7:32:11 PMSiphon

Suat:

I am new to VB, so thi question may be very basic. If I have created forms in Access, how do I call these forms from a VB database to be printed? In other words, from a "print" button on a VB form, I would like to have all forms or certain forms be printed. I hope you can help.
(If this comment was disrespectful, please report it.)

 
3/1/2000 8:30:27 AMRobert

I have tried numerously to input this SQL statement into my own code, as well as to look its parameters up in various sources.

However I keep getting a Error: 3061 Too Few Parameters. Expected 1 error.

What is it and what can I do to fix it...

Thanks!
(If this comment was disrespectful, please report it.)

 
5/23/2000 9:34:09 PMBenjie Fusilero

Hello,
Its very inspiring to have a code like this one. And read a TONS of comments or feedback too.

By the way if you have enough time can i asked to email me the explanation of this part:

SQLText =
"SELECT * FROM DBWords WHERE
Left(dbWord," & Len(reqText) &
")='"
& reqText & "';"

Once again thanks

(If this comment was disrespectful, please report it.)

 
6/8/2000 12:37:20 AMDaryoush

I need a VB database code which deals with more than 1 table (MS Access) without using data control (direct codeing). Please if any body know help me at lashkari@idirect.ca Thank you.
(If this comment was disrespectful, please report it.)

 
6/20/2000 11:02:10 PMEamonn

i am running windows NT4sp6 and VB5sp3
i tried your code to create a database and keep getting the error "Active X component can't create object" when it trys to createdatabase. I have referenced
Micrisoft ActiveX Data Objects 2.0 Library and
Microsoft DAO 3.51 Object Library
I hope you can help as your programme
layout looks very good
thanks
eamonn

(If this comment was disrespectful, please report it.)

 
12/15/2000 7:28:27 PMSuat OZGUR

Hi again,
I was realy away for this long time so i couldnot see your feedbacks. First of all, thank you very much everyone for all kind of idea.
Eugene Almanon : my email address is smozgur@hotmail.com.
Sam : Yes, you are right and i just want to use natural code not statements but i think that i changed it. Anyway, you are definetely right about LIKE operator.
AmNeStY : Thanks. Contact with me. I am trying to plan to create a web site like a Database Tutorial.
Siphon : There is a way to use objects in Access within Visual Basic. If you see this message please contact with me.

(If this comment was disrespectful, please report it.)

 
12/15/2000 7:33:26 PMSuat OZGUR

Robert : Your code plly has a string syntax error. It is really easy to recover. Tell me if you still have problem, please with your SQLtxt.
Benjie : It is just filtering records for the characters which user typed. If user type "sm" then it looks for if there is a word begin with "sm", also if user type "smo" then it will look for "smo". Thats all. And you can also use Like operator like Sam said above.
Eamonn : Please let me know about your code.

Ok, i think nobody will turn this page :) but thanks for feedback and Enjoy Database Programming!
(If this comment was disrespectful, please report it.)

 
5/8/2003 7:32:36 AM

>Ok, i think nobody will turn this page

nobody?? here is a late beginner ;)

(If this comment was disrespectful, please report it.)

 
11/22/2006 4:42:16 AMOrhan

thank`ss
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.