answersLogoWhite

0


Best Answer

Private Sub Command1_Click()

Dim db_file As String

Dim conn As ADODB.Connection

Dim rs As ADODB.Recordset

Dim num_records As Integer


' Get the database name.

db_file = App.Path

If Right$(db_file, 1) <> "" Then db_file = db_file & _

""

db_file = db_file & "People.mdb"


' Open a connection.

Set conn = New ADODB.Connection

conn.ConnectionString = _

"Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=" & db_file & ";" & _

"Persist Security Info=False"

conn.Open


' Drop the Employees table if it already exists.

On Error Resume Next

conn.Execute "DROP TABLE Employees"

On Error GoTo 0


' Create the Employees table.

conn.Execute _

"CREATE TABLE Employees(" & _

"EmployeeId INTEGER NOT NULL," & _

"LastName VARCHAR(40) NOT NULL," & _

"FirstName VARCHAR(40) NOT NULL)"


' Populate the table.

conn.Execute "INSERT INTO Employees VALUES (1, " & _

"'Anderson', 'Amy')"

conn.Execute "INSERT INTO Employees VALUES (1, 'Baker', " & _

" 'Betty')"

conn.Execute "INSERT INTO Employees VALUES (1, 'Cover', " & _

" 'Chauncey')"

' Add more records ...


' See how many records the table contains.

Set rs = conn.Execute("SELECT COUNT (*) FROM Employees")

num_records = rs.Fields(0)


conn.Close


MsgBox "Created " & num_records & " records", _

vbInformation, "Done"

End Sub

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Code for inserting data in oracle through vb6.0?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Where can one purchase Oracle Data Guard?

Oracle Data Guard is program that manages, monitors, and maintains Oracle software. One can purchase Oracle Data Guard on Oracle's official website, or Slideshare.


What is the meaning of i in oracle9i?

Oracle i means "Internet", that means oracle manipulate data via internet. But next oracle comes with "Grid Computing" and rename with 'g'


What is oracle?

Oracle is made up of a set of processes running in your operating system. These processes manage how data is stored and how it is accessed. It is a database system through which we can manipulate the date through different process.


How does ms access database save the data after inserting data into the table?

i want to get some logical arguments about to save the data after inserting data into the table in the ms access i want to get some logical arguments about to save the data after inserting data into the table in the ms access


What is difference between c and pro c?

C is the computer language bases on K&amp;R's language that has evolved over the years. It includes C++, as extended by Stroustroup.. Pro*C is an Oracle precompiler that will read a C or C++ program, detect Oracle extensions to it, and convert it to native code for subsequent processing by the C or C++ compiler. This involves building the data structures and function calls needed to use Oracle while passing the non-Oracle C or C++ code through intact. The amalgamated code is then processed by the C or C++ compiler and it now works with Oracle.


What is mean by distinct in oracle?

the distinct in oracle is there is no repetition of data in a query


What are the commands of DML?

Retrieving Data,Inserting Data,and Deleting Data.


What is the purpose of a data dictionary in Oracle?

A data dictionary is a centralized repository of information about data,. The purpose of a data dictionary in oracle is to indicate a more general software utility than a catalogue.


How much data store in oracle database?

Oracle has many versions like 9i, 10g, 11g, 12c .Oracle database can store infinte data unless you have put any restriction on it.


How to import Data from .txt file to oracle 10g table?

Use SQLLoader utility of Oracle


Where is it possible to download data protection software?

Oracle offers some of the top of the line data protection software. If you are looking to ensure that your data stays safe and sound, then Oracle is the one to choose.


What is manipulating of data?

Data manipulation is the process of changing or transforming data to make it more organized, accessible, or useful for analysis, reporting, or other purposes. This can involve tasks such as filtering, sorting, summarizing, merging, or transforming data in various ways using tools like spreadsheets, databases, or programming languages.