Hello, I just only want to ask.How to connect MS access database to a C program.See the code below:

#include<stdio.h>
char firstname[20], middlename, lastname[20];
main()
{
clrscr();
printf("Enter your First Name: ");scanf("%s",&firstname);
printf("Enter your Middle Name: ");scanf("%c",&middlename);
printf("Enter your Last Name: ");scanf("%s",&lastname);
getch();
}

This is what I want to do for example I have a database file named myname.mdb and in that database there are three fields: fname, mname and lname.

I want the value of firstname pass to fname, middlename pass to mname, and lastname pass to lname

Recommended Answers

All 2 Replies

Hello, I just only want to ask.How to connect MS access database to a C program.See the code below:

#include<stdio.h>
char firstname[20], middlename, lastname[20];
main()
{
clrscr();
printf("Enter your First Name: ");scanf("%s",&firstname);
printf("Enter your Middle Name: ");scanf("%c",&middlename);
printf("Enter your Last Name: ");scanf("%s",&lastname);
getch();
}

This is what I want to do for example I have a database file named myname.mdb and in that database there are three fields: fname, mname and lname.

I want the value of firstname pass to fname, middlename pass to mname, and lastname pass to lname

f

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.