473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to create database in & connect MS-ACCESS with VISUAL BASIC?

3
how to create database in Ms-Access & how to connect that database with
Visual Basic-6.0, if i work in standalone system? Kindly let me know the details??
Sep 21 '06 #1
1 2598
Rahna
12
how to create database in Ms-Access & how to connect that database with
Visual Basic-6.0, if i work in standalone system? Kindly let me know the details??

Hope this piece of code will help you to get started.

Dim Ageconn As New ADODB.Connection
Dim Ageset As New ADODB.Recordset

Private Sub Form_Load()

Ageconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyDB.mdb;Persist Security Info=False"
Ageconn.Open
If Ageconn.State <> adStateOpen Then
MsgBox "Error...!!! Connection not Open", vbCritical, "Connectivity Problem"
End If
Ageset.ActiveConnection = Ageconn
Ageset.CursorLocation = adUseClient
Ageset.CursorType = adOpenDynamic
Ageset.LockType = adLockOptimistic
Ageset.Source = "select * from MyTable"
Ageset.Open

Ageset.AddNew
Ageset.Fields(0) = 1
Ageset.Fields(1) = Name
Ageset.Fields(2) = Address
Ageset.Fields(3) = Phone
Ageset.Fields(4) = PIN
Ageset.Update

Ageset.Close
Ageconn.Close

Regards,
Sep 21 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
0
by: Eric Lavitsky | last post by:
Hi, I'm trying to connect using PHP5 to a web service created with the MS SOAP Toolkit3 that supports DIME attachments. PHP fails connecting to the service, for example: <?php $wsdl =...
1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
3
by: Marcel | last post by:
<?php I have a question about 2 connection strings to a ms sql database. # TEST DATABASE $connecttest = MSSQL_CONNECT("TEST", "sa", "123456") or exit("Unable to connect to MS SQL Server at...
1
by: Sori Schwimmer | last post by:
Hi, I am working on an application which involves interprocess communication. More to the point, processes should be able to notify other processes about certain situations, so the "notifyees"...
2
by: mxd349 | last post by:
Operating system: Linux 7.X DB2 version: 8.1 I am new to DB2 and I have 2 problems: 1- Although I have schedule a database backup for 9:30 PM nightly, it runs at 10:16 PM. I have scheduled...
5
by: rAinDeEr | last post by:
Hi, Y'day one of my friend showed me how to connect to a Oracle database as SYSDBA, DBA etc I have DB2 UDB installed in Linux machine.Right now, I have a user WADI which has got some...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
2
by: Hetal | last post by:
Hi... I am a newbie VB.NET developer and i am looking at working with ADO.NET rather than ADO. In one of our native VB application with ADO, we used to create 1 connection object and that would...
3
by: DeanL | last post by:
Hi guys, Does anyone know of a way to create multiple tables using information stored in one table? I have a table with 4 columns (TableName, ColumnName, DataType, DataSize) and wanted to know...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.