Connecting Tech Pros Worldwide Forums | Help | Site Map

how to load access as database using ListView (VB6)

nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#1: Aug 21 '07
anyone please help me.. wat is the syntax,method or code that will use to connect access as database using the List View in VB6..tnx..

hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#2: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by nhaztieh

anyone please help me.. wat is the syntax,method or code that will use to connect access as database using the List View in VB6..tnx..


Can you explain little bit more about your requirement, front-end versons and Back-end versons
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#3: Aug 21 '07

re: how to load access as database using ListView (VB6)


tnx 4 reply.. i am having a problem in my program..

my prof want me to create a program add, delete, save, update, edit, and exit button..

using the List View i need to display my database access2000..i am using vb6..

CAN YOU HELP ME.. wat code or method am i going to use here??
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#4: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by nhaztieh

tnx 4 reply.. i am having a problem in my program..

my prof want me to create a program add, delete, save, update, edit, and exit button..

using the List View i need to display my database access2000..i am using vb6..

CAN YOU HELP ME.. wat code or method am i going to use here??

List View is only for read only purpose. you can not edit list view.

to save, update and delete you have to write Database queryes.

1. you can list all record in list view.
2. when you select data in list view then; write code to place the selected data
in appropriate text box.
3. in text box you can edit or delete and Save it.

to fill listview Code will be here
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#5: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by hariharanmca

List View is only for read only purpose. you can not edit list view.

to save, update and delete you have to write Database queryes.

1. you can list all record in list view.
2. when you select data in list view then; write code to place the selected data
in appropriate text box.
3. in text box you can edit or delete and Save it.

to fill listview Code will be here


Try your best then post what you had been done. So it will be easy to guide you.


Good luck nhaztieh
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#6: Aug 21 '07

re: how to load access as database using ListView (VB6)


yes i have 3 text box for Student Name, Student No., and Student Address

i'L try your code..tnx again
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#7: Aug 21 '07

re: how to load access as database using ListView (VB6)


i need to import my database (access2000) what code am i going to use??

using the List View??
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#8: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by nhaztieh

i need to import my database (access2000) what code am i going to use??

using the List View??

you cannot use listview to load MS acces DB.

1. Better use ADODB reference to connect database.
2. then use sql queries like select, update and delete query.

Is your project is multi user interface (Clients and server)?
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#9: Aug 21 '07

re: how to load access as database using ListView (VB6)


ADODB?? is it similar to ADODC??
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#10: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by nhaztieh

ADODB?? is it similar to ADODC??

Yes, But if you know ADODC conectivity then; just try in ADODC, no problem. Both are more or less same code.
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#11: Aug 21 '07

re: how to load access as database using ListView (VB6)


huhu.. i dont know what to do.. im a newbie in VB6..

any other components instead of ADODB/C to import my database?

my prof want me to use the List View to call my database.. i am not familiar in List View and ADO.. huhuhu
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#12: Aug 21 '07

re: how to load access as database using ListView (VB6)


i also try d DATA but it seems like there is a problem..

Unrecognized database format..
hariharanmca's Avatar
Lives Here
 
Join Date: Dec 2006
Location: Banglore/India
Posts: 1,987
#13: Aug 21 '07

re: how to load access as database using ListView (VB6)


Quote:

Originally Posted by nhaztieh

huhu.. i dont know what to do.. im a newbie in VB6..

any other components instead of ADODB/C to import my database?

my prof want me to use the List View to call my database.. i am not familiar in List View and ADO.. huhuhu

Okay

1. Use ADODC to connect your Database
2. In List View properties select ADODCName in Datasource
3. And for each sub items's Datafield, select Table fields

now, your listview will fill with data.
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#14: Aug 21 '07

re: how to load access as database using ListView (VB6)


To access your database use the ADO data control. you use it to link the database into your project. Assuming you have the user names and passwords stored in a table in the database the rest is just a little bit of creativity.

1. create an ADO control and connect it to the database using it's connection string property

2. connect the ADO control to the table containing your users/passes using the controls record source property, ensure that you select cmdTable as the command type (alternatively you could access a query in the same way as this or other access objects but lets stick to tables for now)

3. create a flexgrid Hierarchal control and set it up (row and columns amounts etc.) ready to be populated by the database table

4. read the data from the table into the flexgrid

5. when the user enters the user name / pass you will want to check first for the user name (that it is present in the grid) and then check that the passwords match up ( check the password in the row that is the same as the identified user name row, eg if my user is Sedecrem and a 'Sedecrem' is present on row 6 you will want to check the contents or your password box against row 6, password column). i wont go into specifics but post back if you have trouble with syntax or getting around it.

6. as this is a security based program i would recommended putting a password on the database (in Access) so a clever user just doesn't open that to hack your program. You then would put the database password into the password property of the ADO control. also i would ensure that you make the ADO and flex grid invisible

7. if your toolbox does not contain the controls i have mentioned you can add them to it by using Ctrl+T in VB, opening the Components dialog.



I cant follow his Procedure..please guide me..
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#15: Aug 21 '07

re: how to load access as database using ListView (VB6)


when i go to Connection String Property

There are 3 source of connection:
1. Use Data Link File
2. Use ODBC Data Source Name
3. Use Connection String

In No. 2 ..I chose Ms Access Database and click apply..
nhaztieh's Avatar
Newbie
 
Join Date: Aug 2007
Location: philippines
Posts: 13
#16: Aug 21 '07

re: how to load access as database using ListView (VB6)


[Okay

1. Use ADODC to connect your Database
2. In List View properties select ADODCName in Datasource
3. And for each sub items's Datafield, select Table fields

now, your listview will fill with data.]

There is No Datasource in List View..
Reply


Similar Visual Basic 4 / 5 / 6 bytes