I,
i am beginner in VB programming.
I am developing a software using Vb as front end & database in foxpro.
Can anybody help me to connect entered text in textboxes to database.
How it is saved in database & retrieval.
I am using DAO tool.

Neeraj Pareek

Do you have a need to connect/use foxpro? i.e. - does your company require that you connect to an old foxpro database or som'n? If not, then I would suggest using MSSQL server express, SQLite, firebird, etc...

why r u using foxpro?
instead of it use access database to store data.
as it is more reliable,fast and easy.

also use ADO technology rather than using DAO.
coz it is most advanced and more powerful.

Check out this beginner tutorial on connecting with access databases using ADO

regards
Shouvik

Hi shouvik,

thanx for your suggestion.
I tried through ADO but was unsuccesful.
i am using mdiform with 15 forms.
I checked with ADO but it was not saving text properties in database.

can you help me?

Regards
Neeraj
should i put ADO control on single form or on each form?

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..

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..

thanx for your information.
i already did but unsuccesful.
i want to know i thing that should i place a ADO on single form or place 1 ADO on each form?
i set database by ODBC settings as COntrol Panel - Administrative Tools.
If you know little bit more please tell me.

Thanx & regards

can anyone help me?
I am begginer in VB & trying to develop a application to help my friend.
I am getting difficulty in Database connectivity.
I am using multiple form with main MDI form.
Should i put ADO control on each form or only on one form to access data from database.
Please guide me.

Try to use ADO code for better result.

can anyone help me?
I am begginer in VB & trying to develop a application to help my friend.
I am getting difficulty in Database connectivity.
I am using multiple form with main MDI form.
Should i put ADO control on each form or only on one form to access data from database.
Please guide me.

You should use ado on your classes, not your forms as a general design rule. Generally this would be called a data access layer.

But, if you're just doing a quick and dirty forms app then you can add ado access in the forms events (button1_click) ect...

I would rcommend that you create a module funcion that returns an ado command object with the connection already created. This way, you have your code in one place which makes for easy maintenance. Then within your forms, you set your ado cmd object to the result of that function and then issue the commands you need.

If you are retrieving a database result set back, then assign your recordset object that and do the processing of the results within the form.

Just one more question... why are you not using VB.NET? It's much, much more intuitive. And free.

Hi,
thanks for youe help.
yesterday i tried through writing cod ein module & go success.
but by this way i am not be able to connect with foxpro database?
is it possible then how?
one more thing it is giving error when i am choosing MS Access Xp database,
that "unrecognized Datadase" or "Invalid path".

Regards
Neeraj


i

You should use ado on your classes, not your forms as a general design rule. Generally this would be called a data access layer.

But, if you're just doing a quick and dirty forms app then you can add ado access in the forms events (button1_click) ect...

I would rcommend that you create a module funcion that returns an ado command object with the connection already created. This way, you have your code in one place which makes for easy maintenance. Then within your forms, you set your ado cmd object to the result of that function and then issue the commands you need.

If you are retrieving a database result set back, then assign your recordset object that and do the processing of the results within the form.

Just one more question... why are you not using VB.NET? It's much, much more intuitive. And free.

You need to convert the access database into 97 format .

it is very simple. drag a data control to your form, give the database name from properties, select the record source(name of table to use) from the properties window.
then link the text boxes to the fields of the table e.g. select "name" text box set its data source as name of 'data control ' and data member property to the name field of the table. if u got it i wll gv u code for add and save controls later.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.