PDA

View Full Version : سوال: ارتباط با دیتابیس رمز گذاری شده به وسیله کدنویسی



microprolog-p96s
چهارشنبه 30 تیر 1389, 20:36 عصر
سلام

از همه دوستان و استاتید تشکر میکنم

یک برنامه هست که دیتابس اون در یک فایل دیگه هست و رمزگذاری شده . می خواستم که به وسلیه کدنویسی از تو برنامه به اون دیتابیس وصل بشم . البته این رو بگم که دیتابس به برنامه لینک شده است .

smderfan
پنج شنبه 31 تیر 1389, 17:43 عصر
سلام
فكر كنم از ماژول زير استفاده كنيد مشكل شما حل شود.


Creating a Linked Table
Linking (also known as attaching) a table from an external database allows you to read data, update and add data (in most cases), and create queries using the table in the same way as you would with a table native to the database.
With Microsoft Jet you can create links to Microsoft Jet data, ISAM data (Text, FoxPro, dBASE, and so on), and ODBC data. Tables that are linked through ODBC are sometimes called pass-through tables.
The following listings demonstrate how to create a table that is linked to a table in another Microsoft Jet database.
DAO
Sub DAOCreateAttachedJetTable()

Dim db As DAO.Database
Dim tbl As DAO.TableDef

' Open the database
Set db = DBEngine.OpenDatabase(".\NorthWind.mdb")

' Create a new TableDef object.
Set tbl = db.CreateTableDef("Authors")

' Set the properties to create the link
tbl.Connect = ";DATABASE=.\Pubs.mdb;pwd=password;"
tbl.SourceTableName = "authors"

' Add the new table to the database.
db.TableDefs.Append tbl

db.Close

End Sub
ADOX
Sub ADOCreateAttachedJetTable()

Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table

' Open the catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.\NorthWind.mdb;"

' Set the name and target catalog for the table
tbl.Name = "Authors"
Set tbl.ParentCatalog = cat

' Set the properties to create the link
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Datasource") = ".\Pubs.mdb"
tbl.Properties("Jet OLEDB:Link Provider String") = ";Pwd=password"
tbl.Properties("Jet OLEDB:Remote Table Name") = "authors"

' Append the table to the collection
cat.Tables.Append tbl

Set cat = Nothing

End Sub

azadich
چهارشنبه 21 اردیبهشت 1390, 00:28 صبح
سلام
فكر كنم از ماژول زير استفاده كنيد مشكل شما حل شود.


Creating a Linked Table
Linking (also known as attaching) a table from an external database allows you to read data, update and add data (in most cases), and create queries using the table in the same way as you would with a table native to the database.
With Microsoft Jet you can create links to Microsoft Jet data, ISAM data (Text, FoxPro, dBASE, and so on), and ODBC data. Tables that are linked through ODBC are sometimes called pass-through tables.
The following listings demonstrate how to create a table that is linked to a table in another Microsoft Jet database.
DAO
Sub DAOCreateAttachedJetTable()

Dim db As DAO.Database
Dim tbl As DAO.TableDef

' Open the database
Set db = DBEngine.OpenDatabase(".\NorthWind.mdb")

' Create a new TableDef object.
Set tbl = db.CreateTableDef("Authors")

' Set the properties to create the link
tbl.Connect = ";DATABASE=.\Pubs.mdb;pwd=password;"
tbl.SourceTableName = "authors"

' Add the new table to the database.
db.TableDefs.Append tbl

db.Close

End Sub
ADOX
Sub ADOCreateAttachedJetTable()

Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table

' Open the catalog
cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.\NorthWind.mdb;"

' Set the name and target catalog for the table
tbl.Name = "Authors"
Set tbl.ParentCatalog = cat

' Set the properties to create the link
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Datasource") = ".\Pubs.mdb"
tbl.Properties("Jet OLEDB:Link Provider String") = ";Pwd=password"
tbl.Properties("Jet OLEDB:Remote Table Name") = "authors"

' Append the table to the collection
cat.Tables.Append tbl

Set cat = Nothing

End Sub

اگه نمونه بزاری ممنون میشم