| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 You can use a Common Dialog control placed on a form somewhere to use this, or set opnFilename to the complete path and filename with extension. Also you will need to have Microsoft DAO 3.51 or 3.6 referenced. From what I have seen and used so far, the table name must not have spaces in it to do this. I personally just temporarily renamed the table and then used it. \par \par Dim opnFileName As String \par Dim strTempStr As String \par Dim tableName As String \par Dim intFileSep As Integer \par Dim DatabaseName As Database \par \par For intFileSep = Len(opnFileName) To 1 Step -1 \par If Mid$(opnFileName, intFileSep, 1) = "\\" Then Exit For \par Next intFileSep \par \par strTempStr = "SELECT * INTO [dBase IV;DATABASE=" + _ \par Left$(opnFileName, intFileSep - 1) + "].[" + _ \par Left$(Right$(opnFileName, Len(opnFileName) - intFileSep), _ \par Len(Right$(opnFileName, Len(opnFileName) - intFileSep)) - 4) + "]" & " FROM ["& tableName &"]" \par \par DatabaseName.Execute strTempStr \par } |
Export Access Tables to Other Formats Using a SQL |
India web developer web development India | India web development company India ecommerce web developer