http://www.microsoft.com/data/
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=admin;" & _
"Pwd="'
Create and Open Connection Object
Set Conn = CreateObject("ADODB.Connection")
Conn.Open DBConStr
";Data Source=192.168.2.10;User Id=sa;Password=password;Connect Timeout = 10;" & _
"Initial Catalog=Northwind;"'
Create and Open Connection Object
Set Conn = CreateObject("ADODB.Connection")
Conn.Open DBConStr
AbsolutePage
Long
AbsolutePosition
Long
ActiveCommand
Variant
ActiveConnection
String
BOF
Boolean
Bookmark
Variant
CacheSize
Long
CursorLocation
Long
CursorType
CursorTypeEnum
DataMember
String
DataSource
EditMode
EditModeEnum
EOF
Boolean
Fields
Field
Filter
Variant
Index
String
LockType
LockTypeEnum
MarshalOptions
xtdLong
MaxRecords
Long
PageCount
Long
PageSize
Long
Properties
Property
RecordCount
Long
Sort
String
Source
String
State
Long
Status
RecordStatusEnum
StayInSync
Boolean
AddNew
Cancel
CancelBatch
CancelUpdate
Clone
Close
CompareBookmarks
Delete
Find
GetRows
GetString
Move
MoveFirst
MoveLast
MoveNext
MovePrevious
NextRecordset
Open
Requery
Resync
Save
Seek
Supports
Update
UpdateBatch
";Data Source=192.168.2.10;User Id=sa;Password=password;Connect Timeout = 10;" & _
"Initial Catalog=Northwind;"
'Create and Open Connection Object
Set Conn = CreateObject("ADODB.Connection")
Conn.Open DBConStr
'Create and Open Employee Recordset Object
Set EmpRS=CreateObject("ADODB.Recordset")
EmpRS.CursorType=1
EmpRS.LockType=3
EmpRS.Open "Suppliers",Conn,1,3,adCmdTable
'Add New Record
EmpRS.AddNew
'Set Field Data
EmpRS("CompanyName").value="CompanyName"
EmpRS("ContactName").value="ContactName"
EmpRS("ContactTitle").value="ContactTitle"
EmpRS("Address").value="Address"
EmpRS("City").value="City"
EmpRS("Region").value="Region"
EmpRS("PostalCode").value="PostalCode"
EmpRS("Country").value="Country"
EmpRS("Phone").value="Phone"
EmpRS("Fax").value="Fax"
EmpRS("HomePage").value="HomePage"
'Update To Record
EmpRS.Update
'Clean up
EmpRS.Close
Conn.Close
Set EmpRS=Nothing
Set Conn=Nothing
Exit Sub
ErrorHandler:
'Clean up
If Not EmpRS Is Nothing Then
If EmpRS.State = adStateOpen Then EmpRS.Close
End If
Set EmpRS = Nothing
If Not Conn Is Nothing Then
If Conn.State = adStateOpen Then Conn.Close
End If
Set Conn = Nothing