<pre id=code><font face=courier size= id=code>
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 'Windows-Standard
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim SQL As String
Set db = OpenDatabase(App.Path, False, False, "DBASE IV;DATABASE=" & App.Path & "\DBIV")
SQL = "CREATE TABLE TEST(" & _
"ID COUNTER, " & _
"FIELD1 TEXT(254), " & _
"FIELD2 LONG, " & _
"FIELD3 INTEGER, " & _
"FIELD4 DOUBLE" & _
")"
db.Execute SQL, dbFailOnError
db.TableDefs.Refresh
SQL = "SELECT * FROM TEST"
Set rs = db.OpenRecordset(SQL, dbOpenDynaset)
rs.AddNew
rs!FIELD1 = "TEST"
rs!FIELD2 = "1"
rs!FIELD3 = "2"
rs!FIELD4 = "3"
rs.Update
rs.Close
db.Close
End Sub
</font id=code></pre id=code>
Da incollare con Notepad in una form nuova. Fare riferimento al DAO 3.5 o 3.6
Giovanni
---
http://www.y2ksw.com/vbulletin