نمایش نتایج 1 تا 3 از 3

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

  1. #1

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

    سلام

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

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

  2. #2
    کاربر دائمی آواتار smderfan
    تاریخ عضویت
    اسفند 1384
    محل زندگی
    OFFICE11\MSACCESS
    پست
    721

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

    سلام
    فكر كنم از ماژول زير استفاده كنيد مشكل شما حل شود.

    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

  3. #3

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

    نقل قول نوشته شده توسط smderfan مشاهده تاپیک
    سلام
    فكر كنم از ماژول زير استفاده كنيد مشكل شما حل شود.

    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
    اگه نمونه بزاری ممنون میشم

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •