Search This Blog
Saturday, November 27, 2010
How to recover your data if main OS fails
Suppose your operating system crashed and you wanted to recover the data. One of the options is to boot your computer using a bootable flash drive. Nowadays, almost all of the modern computers support booting from the usb flash drive. All you have to do is download the iso image of the linux desktop and you can follow instructions from this site http://www.pendrivelinux.com/
Importing dbf file to Access in vb
Few years back I have to create a script that will import dbf files to access. Of course we can always do this using import options in access. But as it happens I'm tired of doing it manually so I decided to write a script for this routine. What we need to do is just to invoke the docmd.transferDatabase as seen in the created fuction below.
Dim MyTable As TableDef
Dim MyDatabase As Database
Dim strLastUpdate, strDateCreated As Date
Dim Myrs As Recordset
Dim intcount As Integer
'Function to Import database in dbf format
Public Function ImportDatabases(ByVal strDatabaseNametoImport As String, _
ByVal strDatabaseSource As String, _
ByVal strDatabaseType As String, _
ByVal strNameofTable As String)
Dim BlExist As Boolean
BlExist = fn_IsexistTable(Trim(strNameofTable))
If BlExist = True Then
If MsgBox(" Warning!! Table " & strNameofTable & " Already Existing. Last Update was " & strLastUpdate & " Overwrite?", vbQuestion + vbYesNo, "Downtime System") = vbYes Then
fn_DeleteTable Trim(strNameofTable)
DoCmd.TransferDatabase acImport, strDatabaseType, strDatabaseSource, acTable, strDatabaseNametoImport, strNameofTable, False
MsgBox "Finished Importing Table " & Trim(strNameofTable)
Else
Exit Function
End If
Else
DoCmd.TransferDatabase acImport, strDatabaseType, strDatabaseSource, acTable, strDatabaseNametoImport, strNameofTable, False
MsgBox "Finished Importing Table " & Trim(strNameofTable)
End If
End Function
Dim MyTable As TableDef
Dim MyDatabase As Database
Dim strLastUpdate, strDateCreated As Date
Dim Myrs As Recordset
Dim intcount As Integer
'Function to Import database in dbf format
Public Function ImportDatabases(ByVal strDatabaseNametoImport As String, _
ByVal strDatabaseSource As String, _
ByVal strDatabaseType As String, _
ByVal strNameofTable As String)
Dim BlExist As Boolean
BlExist = fn_IsexistTable(Trim(strNameofTable))
If BlExist = True Then
If MsgBox(" Warning!! Table " & strNameofTable & " Already Existing. Last Update was " & strLastUpdate & " Overwrite?", vbQuestion + vbYesNo, "Downtime System") = vbYes Then
fn_DeleteTable Trim(strNameofTable)
DoCmd.TransferDatabase acImport, strDatabaseType, strDatabaseSource, acTable, strDatabaseNametoImport, strNameofTable, False
MsgBox "Finished Importing Table " & Trim(strNameofTable)
Else
Exit Function
End If
Else
DoCmd.TransferDatabase acImport, strDatabaseType, strDatabaseSource, acTable, strDatabaseNametoImport, strNameofTable, False
MsgBox "Finished Importing Table " & Trim(strNameofTable)
End If
End Function
Subscribe to:
Posts (Atom)