INFORME SOBRE COMO CONECTAR VISUAL BASIC 6.0 A LAS SIGUIENTES BASES DE
DATOS.
Pedro Montero
C.I.26653797
Codigo: 50
 Microsoft Access 2003
Option Explicit
Private conexion As ADODB.Connection
Private WithEvents record As ADODB.Recordset
//esto va en el form
Private Sub Form_Load()
Set conexion = New ADODB.Connection
Set record = New ADODB.Recordset
record.LockType = adLockOptimistic
record.CursorType = adOpenKeyset
With conexion //esta condicion es para evitar escribir la variable conexion varis veces
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path &
"archivo.mdb; persist security info=False"
.Open
End With
End Sub
 Microsoft SQL Server 2008
Dim Con As New ADOD.Connection
Dim Rec As New ADODB.Recordaet
Private Sub Command1_click
Con.Open “Driver=SQL Server/Server. /SQLEXPRESS;
Database=FQMS;uid=aa:pwd=saj”
Rec.Open “Select * from database where dbname = ‘ & text1.text & “ ’ ”, con, adOpen5tatic,
adLockReadOnly
If Rec.Recordcount > 0 then
Text2.text Rect.Fields! Location
End If
Rec.close
Con.close
End sub
 MySQL
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim sql$
Set cnn = New ADODB.Connection
cnn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=xx.xxx.xx.xx;" _
& "DATABASE=MIBASE;" _
& "UID=miusuario;PWD=miclave;PORT=3306;OPTION=131072"
cnn.Open
Set rst = New ADODB.Recordset
sql$ = "select Lugar.Provincia from Lugar where Lugar.Region='" & Combo1 & "' Group by
Lugar.provincia"
With rst
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open sql$, cnn, , , adCmdText

More Related Content

DOCX
javascript code for mysql database connection
PPT
VooDoo Driver
PDF
Rabin Shrestha: Data Validation and Sanitization in WordPress
PDF
OpenID at Open Tech 2008
PPTX
Data base connectivity and flex grid in vb
PPT
vishual basic data base Pankaj
PDF
DATABASE MANAGEMENT SYSTEM
javascript code for mysql database connection
VooDoo Driver
Rabin Shrestha: Data Validation and Sanitization in WordPress
OpenID at Open Tech 2008
Data base connectivity and flex grid in vb
vishual basic data base Pankaj
DATABASE MANAGEMENT SYSTEM

Similar to Informe sobre como conectar visual basic 6 (20)

PPT
MYSQL database presentation slides with examples
PDF
Oracle to vb 6.0 connectivity
PPTX
PPTX
Ms access
PDF
Visual basic databases
PPTX
Day 1
PDF
What are Database Access Types. Please give detailed explanation to .pdf
PPT
30 5 Database Jdbc
PDF
Bt0066 database management system1
PDF
PPT
Uses of MS Access in Business
PPTX
Introduction to database with ms access.hetvii
PPTX
Introduction to database with ms access(DBMS)
PPT
Microsoft Access 2007
ODP
Open Source Databases Webinar
PPTX
2.3.1 creating database, table and relationship on Access 2003
PPT
Jdbc
PPT
PPTX
Database concepts using libre office base
PPTX
Database concepts using libre office base
MYSQL database presentation slides with examples
Oracle to vb 6.0 connectivity
Ms access
Visual basic databases
Day 1
What are Database Access Types. Please give detailed explanation to .pdf
30 5 Database Jdbc
Bt0066 database management system1
Uses of MS Access in Business
Introduction to database with ms access.hetvii
Introduction to database with ms access(DBMS)
Microsoft Access 2007
Open Source Databases Webinar
2.3.1 creating database, table and relationship on Access 2003
Jdbc
Database concepts using libre office base
Database concepts using libre office base
Ad

More from Pedro Montero (6)

DOCX
Geologia
PPTX
Geologia 1
PPTX
Geologia 1
DOCX
Fundamentos de visual basic
PPTX
Geologia
Geologia 1
Geologia 1
Fundamentos de visual basic
Ad

Recently uploaded (20)

PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
Software Engineering and software moduleing
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Java Basics-Introduction and program control
PPTX
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
PPTX
mechattonicsand iotwith sensor and actuator
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
Measurement Uncertainty and Measurement System analysis
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
20250617 - IR - Global Guide for HR - 51 pages.pdf
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Software Engineering and software moduleing
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Java Basics-Introduction and program control
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
mechattonicsand iotwith sensor and actuator
Petroleum Refining & Petrochemicals.pptx
Soil Improvement Techniques Note - Rabbi
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Management Information system : MIS-e-Business Systems.pptx
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Module 8- Technological and Communication Skills.pptx
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Measurement Uncertainty and Measurement System analysis

Informe sobre como conectar visual basic 6

  • 1. INFORME SOBRE COMO CONECTAR VISUAL BASIC 6.0 A LAS SIGUIENTES BASES DE DATOS. Pedro Montero C.I.26653797 Codigo: 50  Microsoft Access 2003 Option Explicit Private conexion As ADODB.Connection Private WithEvents record As ADODB.Recordset //esto va en el form Private Sub Form_Load() Set conexion = New ADODB.Connection Set record = New ADODB.Recordset record.LockType = adLockOptimistic record.CursorType = adOpenKeyset With conexion //esta condicion es para evitar escribir la variable conexion varis veces .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "archivo.mdb; persist security info=False" .Open End With End Sub  Microsoft SQL Server 2008 Dim Con As New ADOD.Connection Dim Rec As New ADODB.Recordaet Private Sub Command1_click Con.Open “Driver=SQL Server/Server. /SQLEXPRESS; Database=FQMS;uid=aa:pwd=saj” Rec.Open “Select * from database where dbname = ‘ & text1.text & “ ’ ”, con, adOpen5tatic, adLockReadOnly If Rec.Recordcount > 0 then Text2.text Rect.Fields! Location End If Rec.close Con.close End sub
  • 2.  MySQL Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Dim sql$ Set cnn = New ADODB.Connection cnn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _ & "SERVER=xx.xxx.xx.xx;" _ & "DATABASE=MIBASE;" _ & "UID=miusuario;PWD=miclave;PORT=3306;OPTION=131072" cnn.Open Set rst = New ADODB.Recordset sql$ = "select Lugar.Provincia from Lugar where Lugar.Region='" & Combo1 & "' Group by Lugar.provincia" With rst .CursorLocation = adUseClient .CursorType = adOpenKeyset .LockType = adLockOptimistic .Open sql$, cnn, , , adCmdText