how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say rs+10 records . now i have to pass there 10 values to another table with same name . can anyone help me with this. i m usinf DAO
. i wrote some codes in dao. i created a function : AddTableField
i m writing it in module so that it can be access from anywhere in the program
this is the code
Sub AddTableField(ptdfTableDef As DAO.TableDef, pstrFieldName As String, pintDatatype As Integer, Optional pintSize As Integer, Optional pblnFixedLength As Boolean, Optional pblnAutoIncrement As Boolean, Optional pblnAllowZeroLength As Boolean, Optional pblnRequired As Boolean, Optional pstrValidationText As String, Optional pstrValidationRule As String, Optional pvarDefaultValue As Variant)
Dim fldX As DAO.Field
Dim intSize As Integer
Set fldX = ptdfTableDef.CreateField()
fldX.OrdinalPosition = ptdfTableDef.Fields.Count
fldX.Name = pstrFieldName
fldX.Type = pintDatatype
If Not IsMissing(pblnAllowZeroLength) Then
If pintDatatype = dbText And pintSize > 0 Then
fldX.Size = pintSize
Else
fldX.Size = GetFieldSize(pintDatatype)
End If
Else
fldX.Size = GetFieldSize(pintDatatype)
End If
If fldX.Type = dbLong Then
If pblnAutoIncrement = True Then
fldX.Attributes = fldX.Attributes Or dbAutoIncrField
End If
End If
If fldX.Type = dbText Or fldX.Type = dbMemo Then
fldX.AllowZeroLength = True
End If
If Not IsMissing(pblnRequired) Then
fldX.Required = pblnRequired
End If
If Not IsMissing(pstrValidationText) Then
fldX.ValidationText = pstrValidationText
End If
If Not IsMissing(pstrValidationRule) Then
fldX.ValidationRule = pstrValidationRule
End If
If Not IsMissing(pvarDefaultValue) Then
fldX.DefaultValue = pvarDefaultValue
End If
ptdfTableDef.Fields.Append fldX
End Sub
.
still i cannot get the transfer done