jhai_salvador 48 Junior Poster

I need to know about Add Edit Delete on VB v6. code form and desin sample
as a Company record or class student record!

Visual Basic v6.

If you are new to visual basic or you want to learn simple database management in vb6.

You can visit my website and download some samples there that i created... http://www.silentproject.tk

jhai_salvador 48 Junior Poster

No Problem..
You can mark this thread now as SOLVE.. Thanks..

jhai_salvador 48 Junior Poster

Heres a sample...

I have created 3 buttons for my toolbar...
The event is Toolbar1_ButtonClick...

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)

Select Case Button.Index 
    Case 1 'This is the first button
        'Your code goes here....
        'Do somthing here...
        '

    Case 2 'This is my second button
        'Your code goes here....
        'Do somthing here...
        '

    Case 3 'This is my third button..
        'Your code goes here....
        'Do somthing here...
        '

End Select

End Sub

Thats it... Hope this will solve your problem..

jhai_salvador 48 Junior Poster

Use ADODB.Connection
Use ADODB.Recordset

rc.AddNew 'Where rc ADODB RecordSet
jhai_salvador 48 Junior Poster

Hello... i have created this thing... but the code was lost.. hehe...

You can Try This thing that i did to make a cyber cafe software:

Just visuallize it... hehe..

You will need:
Use Winsock on Client and in your Server Form.
Separate database for your client - Client Transaction (Time in / Status / Time out)
Main database for your server - (Client Information / Time In / Status / Time Out / Payment Transactions)

Things To do: SERVER:
Winsock must start listening on a specific port. (Port to listen must be same with the client)

Thigs to Do: CLIENT
Winsock connect to the Address and port of the server

Once connected:
Client Sends information (Time in / Status / etc..)  to the Server using winsock (You can use this in a timer so everytime it ticks,  it will send information to the server)

The server will parse the message it recieve...

i did it this way and it works...

Winsock will solve your problem for this kind of software you will make...

I hope this will help you...

jhai_salvador 48 Junior Poster

Here you can use this connection..

Public cn as New ADODB.Connection

Public Sub Con(DBPath as String, optional DBPass as string)

cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBPath & ";Jet OLEDB:Database Password=" & DBPass & ";"

end Sub
jhai_salvador 48 Junior Poster

This Code will demonstrate on how to make a Autologin for WebBrowser Control..

Im using this so i can prevent myself from any Keyloggers..

NOTES:
Reference: Microsoft HTML Library
Control: Webbrowser Control

'Usage: Must be on Web browser control Event (DocumentComplete Event)

AutoLogin WebBrowser1, "Username", "Password"



'Module

Public Sub AutoLogin(ByVal browser As WebBrowser, ByVal uName As String, ByVal uPass As String)

On Error Resume Next
'1. username: name="user" , name="username", name="login", name="email"
'2. password: type="password"

'Reference: Microsoft HTML Library
'Control: Webbrowser Control

Dim HTML As HTMLDocument
Dim HTMLI As HTMLInputElement

Set HTML = browser.Document

    For Each HTMLI In HTML.getElementsByTagName("input")
    
	'<input name="user"
        If HTMLI.Name = "user" Then
        HTMLI.Value = uName
        End If
        
	'<input name="username"
        If HTMLI.Name = "username" Then
        HTMLI.Value = uName
        End If

        '<input name="email"
        If HTMLI.Name = "email" Then
        HTMLI.Value = uName
        End If

	
	'<input name="login"
        If HTMLI.Name = "login" Then

	    'if <input name="login" Type="password"
            If HTMLI.Type <> "password" Then
            HTMLI.Value = uName
            End If

        End If
        
	'if <input Type="password"
        If HTMLI.Type = "password" Then
        HTMLI.Value = uPass
        End If
        
    Next

End Sub

Hope this will help others..
I will mark this Thread now as Solve...

jhai_salvador 48 Junior Poster

ooppsss.... sorry, but you misunderstood me...

what i mean to say is that i am creating a VB Program that will auto login some sites, ex. i want to login to yahoo mail, i will just click that program then i will be logged automatically on that website, or my Username and Password will be type automatically in the input box of that site.

I already done it, but only my username shows and the password dont show.

jhai_salvador 48 Junior Poster

Hello!...

Can anyone help me on this project?

I already have created a simple program called Website manager and ive already release it on my website http://www.silentproject.tk
i want to improve it by adding an Auto login feature for websites like yahoo mail..etc.. does anyone of you know how to do it?...

jhai_salvador 48 Junior Poster

try browsing my website... you can find some downloadable vb6 projects and apps there made by me...

http://www.silentproject.tk

PS: Some of my files and projects there are maybe outdated.. LOL!...

jhai_salvador 48 Junior Poster

try and browse my website
http://www.silentproject.tk
My Projects > 1st Year - 2nd Semister
download the Student Grades project..
i hope it will help you...

jhai_salvador 48 Junior Poster

wops.. i found something...

i can use the BlockInput API right?... it will block the keyboard and mouse input, and i can also unblock it.. i wll just code it in the form event... thanks for all of your help...

jhai_salvador 48 Junior Poster

maybe you forgot to SET it in your declaration....

just maybe.... LoL

jhai_salvador 48 Junior Poster

wow.. thats alot of code for disabling keys... hehe.. but how does it work?... i hope after i disable the keys i can enabled it again...

jhai_salvador 48 Junior Poster

thanks guy... kill task manager huh..
that may solve the viewing of task manager... haha..
SendKeys may solve my problem.. i think..
Thanks Guys...
ill mark this thread as solve if it solve my problem..
il just try it out when im at home...

jhai_salvador 48 Junior Poster

hey guys....
does anyone here knows how to disable and enable CTRL, Alt, windows keys, or Tab key in keyboard?...

because im going to use it in my time cafe client project in vb...

jhai_salvador 48 Junior Poster

hmmm... dont know why you are using data environment... when im doing some report in vb i just use the Data Report thats it....

1. Design Your Data Report.
2. Use the Field Name for your Report field source... (forgot whats the property name for it...LOL)
3. In code in VB....


Datareport1.RecordSource = RS '(Something like that..)


Just explore my vb project and you will get it.... I hope....

jhai_salvador 48 Junior Poster

Yep!... its posible in crystal report...

just create a VIEW for that query...
and use that VIEW in CR as your temporary table,
then do the ADO Thingy in your VB app...

just make sure you delete your VIEW and then Create it again with your sql query in your Code in VB...

jhai_salvador 48 Junior Poster

hmmmm....
Why dont you create a Queery in the database then connect that quiry in the CR

Then use SQL command in deleting and recreating that quiry in your vb app.

In that way you can customize (using the sql command in creating a query view) what will be shown in the report in CR...

Ive already done this one using msAccess as my database and crystal report 10 for the report viewer and it works...

jhai_salvador 48 Junior Poster

why dont you just use a Setup Maker Program or Setup Factory by Indigo Rose, it can generate serial key or password for the installation software...

jhai_salvador 48 Junior Poster

well i think if you are using VB.NET / 2008 you can do this code.. i think... LoL

FormName.ShowDialog()

jhai_salvador 48 Junior Poster

this is in VB.Net right?.... why post here?... hehe..

jhai_salvador 48 Junior Poster

show your form like this example..

Form1.Show vbModal

if you put vbModal when showing a form, this will prevent the user for clicking other form unless the form1 is close...

jhai_salvador 48 Junior Poster

Heres my code again.. and its working.... ive tried it and i also attached a sample.. just take a look at it and try it okie...

'Declaration
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

Public Sub con()

'Open The Connection
cn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Database1.mdb;Jet OLEDB:Database Password=;")

'Open The Recordset
rs.Open "SELECT * FROM Table1", cn, adOpenStatic, adLockOptimistic

End Sub

Private Sub FillCombo_Click()

'Fill The Combo box
While rs.EOF <> True
Combo1.AddItem rs!FirstName
rs.MoveNext
DoEvents 'Add this code so that the system will not freeze...
Wend

End Sub

Private Sub Form_Load()
'Call Sub con
Call con

End Sub

jhai_salvador 48 Junior Poster

here foreign key mean............? please explain

Table1
iNameID AutoNumber
vName (BTW NAME is a keyword that can cause confusion)
iRoll Number

Table2
iClassID AutoNumber
iNameID Number Foreign Key
vClass (BTW Class VBA Keyword)
dDate (BTW Date KeyWord)

Foreign Key means that it has a relationship with the primary key or the iNameID in Table1 is the same as iNameID in Table2...

( I hope i didnt make a mistake.. :D LOL )

jhai_salvador 48 Junior Poster

You can do this one if you like..
I dunno if the code is correct and this is what you want but you can do this..

Use adodb...

Dim cn as ADODB.Connection
Dim rc as ADODB.Recordset
dim cm as ADODB.Command

then..

cn.open "then your connection string"

and then...

cm.CommandText = "your sql command"
cm.execute

while rc.EOF <> True
Combo1.Add rc!FieldName
rc.MoveNext
wend

jhai_salvador 48 Junior Poster

hmmm... data report with condition?...

try browsing to my site > Downloads > AE4AA Projects > Computer Shop...

www.silentproject.cjb.net

..That project my solve your problem...

..its free.. USE IT FOR YOUR PRIVATE STUDY...

..but any Donation would be apreciate... hehehe..

..HOPE YOU WILL LOOK FOR IT... THANKS..

jhai_salvador 48 Junior Poster

Well, i was just about to try ODBC, but i dont now how.. and how does ODBC works?..

===

Hmm?.. use the complete path of the file with the server address..?

Example i have this server address:
192.168.10.1

and i have this path for the database
c:\vb\system.mdb

how?...

jhai_salvador 48 Junior Poster

hi!.. first of ol sory for my bad english....

I have a problem:
I want to create a database system using MSACCESS and VB6 that will be on 3 computers connected via LAN.

1. the 2 computer will be the registration section, and the last 1 will be the payment section.
2. the registration section will simply register some (ex. student information) names, and other personal information. Then that information will be stored or will have a copy in the payment section for payment and assesment...

Hmmm?... is this posible?..

its like they are sharing 1 database...

How can i do it?.. can you give me some simple sample....

Thanks....

jhai_salvador 48 Junior Poster

First of all, sorry coz i dont know where to post this question.. hehe...

hmm.. does any one of you got any idea how will I interview any company?..
what question will i ask so i can create a system for that company?..

ill just need some question so i can start interviewing some company., this is for my computer subject, System Analysist and Design (SAD..well its very sad..)

Got any Idea of a question? (or a system if you have any example..) Im very nervous and :confused: confused...

jhai_salvador 48 Junior Poster

i selected corect provider w/c is Microsoft.Jet.OLEDB.4.0 and it has a corect path for the filename, but still.. its searching for the WORK GROUP information and its missing.. thnx anywayz for your help...

jhai_salvador 48 Junior Poster

yoe... i have tried it out... but there is an error.. it said that. "cannot start application, the workgroup information file is missing..."

go and see this image link:::
[img]http://www.snapdrive.net/files/500452/test.JPG[/img]

jhai_salvador 48 Junior Poster

to set password for your access database(from ms-access) :-

Tools->Security->Set Database Password

to configure the ADODC control :-
right click (on control)>-properties-> In general tab select use connection string->click build->select Microsoft Jet 4.0 OLEDB provider->next->click ... to locate ur db->now uncheck blank password and mention ur db pwd->username always be "Admin"->click Test Connection to confirm.

now go to Authentication tab ->mention "Admin" as username and pwd->go to recordsource tab->select adcmdtable from commandtype dropdown list.
now u can select ur desire table.

tnx man...! :) ill go and try this when i go home.. tnxxxxxxxxx....

jhai_salvador 48 Junior Poster

tnx for your replies.
i already have the code like update, edit, addNew... i just wanted to know how can i set a username and password on my msaccess and conect it to the ado control...

jhai_salvador 48 Junior Poster

can anyone help me on how to create or to set a username and password for my ms-access 2003 database and how can i save or set that username and password in ADO control so that i can edit that database in my vb project without opening that database in ms-access?...

jhai_salvador 48 Junior Poster

hmm... im still a beginner but knows just a litle bit...

check your TEXTBOXes PROPERTIES like DATASOURCE and DATAFIELD.... and on the ADO CONTROL, if you use MSACCESS like msaccess2003, CHECKSTRINGNAME connection must be set to jet 4.0 something like that... i hope i did make a sense... hehe..