|
-
May 27th, 2001, 08:04 PM
#1
Thread Starter
Addicted Member
Database Help!
What where in the database tutorial is how to use SQL Commands? and how wouls I be able to add to a database without haveing to use textboxes?
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 08:26 PM
#2
PowerPoster
1) Umm which one? The one on this site by Karl? If so dunno!
2) Do it exactly the same way you would with a text box.
But instead of a text box put a list box or a combo box or whatever!
i.e Set the datasource and datafield properties of what ever you using!
-
May 27th, 2001, 08:33 PM
#3
Thread Starter
Addicted Member
yea, karls, and I mean how would I be able to add info into a database using varibles, no controls.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 10:30 PM
#4
Thread Starter
Addicted Member
I really need help on this, please!
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 10:38 PM
#5
PowerPoster
ohhh ok sorry!
2 things post in Database forum coz thats were the db experts are!
from a variable!
I'm not at a VB enabled computer but with data controls which you shouldnt be using anyways! you could do something like
After declaring db as databse and rs as recordset etc.
dim field1 as string
field1 = rs.field "name of field here"
Try that i hope it helps!
-
May 27th, 2001, 10:40 PM
#6
Thread Starter
Addicted Member
I usually post here because usually nobody goes to the other forums
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 10:44 PM
#7
PowerPoster
yep does take a bit longer there but i'm usually checking them, chrisjk, jethro and a few others are usually checking them.
How'd it go!
Oh Yeah! The Devil Has Arisen.
my old post count was 666
-
May 27th, 2001, 10:47 PM
#8
Thread Starter
Addicted Member
can you explain what you just told me a little better?
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 11:01 PM
#9
PowerPoster
yep sorry bieng vague maybe!
Dont Use datacontrols but for the sake of easyness i'll let you get away with it!
Dim db as database ' I'm sure you've seen this in Karls tutorial.
dim rs as recordset ' ditto.
Set db.connect = "database path" 'these 2 bits maybe a bit wrong as i cant test them.
set rs = db.recordsource "table name here" ' setting the recordsource to your db
dim field1 as string ' making field1 a string
field1 = rs.field "name of field here" 'setting field1's value as whatever is in rs.field "blah blah" so now field1 contains the values of whats in rs.field "blah".
Hows that?
-
May 27th, 2001, 11:08 PM
#10
Thread Starter
Addicted Member
for all of this do I have to be using Access dbs? because I am useing Database III or IV, I am getting some errors with the code you gave me, I cant figure it out
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 11:14 PM
#11
PowerPoster
ohh yep Access i ddint know you were using dbase!
I dont know much about dbase sorry!
What are the errors?
-
May 27th, 2001, 11:18 PM
#12
Thread Starter
Addicted Member
heres the come I am using now:
Dim db As Database 'I'm sure you've seen this in Karls tutorial.
Dim rs As Recordset 'ditto.
Set db.Connect = "dBASE III;C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER" 'these 2 bits maybe a bit wrong as i cant test them.
Set rs = db.RecordSource("users2") 'setting the recordsource to your db
Dim field1 As String ' making field1 a string
field1 = rs.field "name of field here" 'setting field1's value as whatever is in rs.field "blah blah" so now field1 contains the values of whats in rs.field "blah".
I changed some things because I dont know what I am doing. ok on the db.connect I get an invalid use of property then it ends.
if you could could you make me an access database file with the tables(err the column things) of: NAME EMAIL PASSWORD IM IMSN WINSOCK_NU CONNECTED
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 11:32 PM
#13
PowerPoster
hmmm ok.
Are ya using the Dtatacontrol or not?
If not put one on ya form! Arrghh Jethro's gonna kill me!
On the connect string you have:
Set db.Connect = "C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER"
I've got rid of the dbase part! also put a extension in there.
i.e .txt etc. whatever the dbase extension is!
-
May 27th, 2001, 11:46 PM
#14
Thread Starter
Addicted Member
I am using a data control and its name is data1
Set db.Connect = "C:\Program Files\Microsoft Visual Studio\VB98\fwnmcnSERVER"
that still returns Invalid use of property.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 27th, 2001, 11:47 PM
#15
PowerPoster
ok ok RESTART!
By reading the tutorial i gather you have the datacontrol on your form set the properties of that control to the required dbase file etc.
I.e The connect property, the database name property, and record source property!
Using a variable do this:
Dim field1 as string
field1 = data1.recordsource
Field1 now contains what ever the data controls record source does!
You can do more!
-
May 28th, 2001, 12:01 AM
#16
Thread Starter
Addicted Member
but I want to be able to add names, and the other info into the feilds, the thing I get from that feild1 thing was just the name of my dbase file! that doesnt help me in any way. this whole this is for a server that is holding usernames and names and passwords of people who registered, and Ineed to use the data base to input new info into each field
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 28th, 2001, 12:13 AM
#17
Thread Starter
Addicted Member
heck if this all doesnt work out I am going to go with the best alternative to databases... ini files. Thanks anyway. I am out for the night.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
-
May 28th, 2001, 12:45 AM
#18
PowerPoster
Nah **** no dont do that!
Miss comunication. I persumed you were using access like the most of us!
Should of stated you werent.
Ok but why do you want to use variables to do that?
-
May 28th, 2001, 06:48 AM
#19
Thread Starter
Addicted Member
well over a winsock first the client sends to the host "REG" which then puts the connection in registration mode, which reads registration commands like. NAMEE, EMAIL, PASSS, etc. so it would send info like: NAMEE Frankie . and when it is read it gets the len of the whole sentdata and then take 6 off and gets the right of that value which leaves you with that name. so I need to be able to get Frankie into my data base, under name and so on. Reason I dont use access is because I only have the microsoft works suite on this computer.
Using:
Visual Studio .Net Enterprise
Visual Basic 6.0 Enterprise
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|