Set tdef = db.CreateTableDef(Name, 0, mysource, strconn) Connect is write protected(?) after tabledefs.append If compdiff(oldcon, strconn) = False And compdiff(sourcename, srcname) = False Then GoTo skip '. Sourcename = db.TableDefs(Name).SourceTableName If IsObject(db.TableDefs(Name)) = True Then eflag = True I'm using this to relink tables: (works with NO_DATE_OVERFLOW) Private Sub dsnless_table2(Name As String, strconn As String, Optional srcname As String = "", Optional myflags As Long = 0)ĭim tdef As New TableDef, sourcename As String, mysource As String, db As DAO.Database, eflag As Boolean, oldcon As String So my proposal is to create a startup function, wich tries to create connections using all the odbc drivers on a list until it finds one, and than relinks tables & passtrough queries only if the driver has been changed. It can be done, but it stops most non-professionals. So an attacker has to disassemble the accde file to get the password. A less secure variation is when you hide the connection string in a VBA function, and you distribute an accde file. Side effect: if you create a DAO connection to the server and database where you have linked tables, they will work without prompting for user and password.Īlso, from a security point of view, linked tables can be imported from an accde file into an editable accdb, so it is better to save the tables without user & password, and prompt the user for credentials once at startup. If you create a connection, and later you try to access the same server & database using the same odbc driver main version, then it will reuse that connection, even if you are trying to use different credentials. ![]() MS Access has an undocumented connection pool. Would you please help me fix the issue with the connection string?īouns help if I can save the password within the connection string so I don't have to import the tables when the MS Access Front end is closed and reopened. It only works with the ODBC I manually create with "Disable Date Overflow error" checked. I'm using MySQL ODBC Unicode 8.0 driver and tested the connection with MS Access 32-bit and 64-bit versions. ![]() Set TablesSchema = Conn.OpenSchema(adSchemaTables) " NO_DATE_OVERFLOW=1" & _ 'This is the part that I think it doesn't work in the codeĭelete_ALL_TABLES '' Delete All the old tables before the import However, when I connect using the below connection string in VBA the tables are connected but when I enter a date in the date field or try to delete a record I get a Date Overflow error ''. When I manually set up an ODBC Unicode connection with "Disable Date Overflow error" I'm able to delete records in the MySQL linked table using the MS Access front end. So I have this issue with MySQL linked tables in MS Access:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |