asp.net 串連mssql mysql access Excel 2007資料庫

來源:互聯網
上載者:User

asp教程.net 串連mssql mysql教程 access  excel 2007資料庫教程

本文章收藏了了一款asp.net教程 串連mssql mysql access  excel 2007資料庫,下面分類好了,只要複製過去把串連檔案地址修改成你的就ok了。
mssql

asp.net connection

"server=db server;database=db name;uid=db id;pwd=db password;" providername="system.data.sqlclient"ole db   connection string (dsnless connection):
"provider=sqloledb;data source=db server;user id=db id;password=db password;initial catalog=db name;"
odbc connection string

"dsn=odbc name;user id=db id;password=db password;initial catalog=db name;"

pleasereplace在紅色到您的資料庫資訊字。如果youdon't知道資料庫的資訊,你可以看到這篇文章。
例如:
odbc的名稱:您建立的odbc名稱在控制台>"資料庫">的odbc
資料庫伺服器:sql3xx.mysite4now.com
db名稱:mydemodb_12345
資料庫的id:mydemoid_12345
資料庫密碼:mydemopw


mysql

ole db connection string (dsnless connection):

"driver={mysql}; server=db server; database=db name; user=db id; password=db password; option=3;"

odbc connection string (requires a odbc to be created first):

"dsn=odbc name;user=db id;password=db password;database=db name;"

pleasereplace在紅色到您的資料庫資訊字。
例如:
odbc的名稱:您建立的odbc名稱在控制台>"資料庫">的odbc
ip地址:mysqlxxx.mysite4now.com
db名稱:mysqldemo_12345
資料庫的id:mysqldemo_12345
資料庫密碼:mysqlpw

 

excel

"provider=microsoft.jet.oledb.4.0;data source=path of excel;extended properties=excel 8.0′

替換你的資料庫連接檔案
example : d:www.111cn.netmembermemberidmyexcel.xls

ps教程. if you need to write data into your excel database, please grant write permission to the excel file.

excel 2007

"provider=microsoft.ace.oledb.12.0;data source=path of excel;extended properties=excel 12.0′

替換你的資料連線地址
example : d:hostingmemberwww.111cn.netmyexcel2007.xlsx

如果你需要編寫到excel資料庫的資料,請寫入權限授予到excel檔案。

access

for access db without password protection:

"provider=microsoft.jet.oledb.4.0;data source=path of access db"

for access db with password protection:

"provider=msdasql;driver={microsoft access driver (*.mdb)};dbq=path of access db;password=password of db"

替換你的資料庫連接地址
example : d:hostinghttp://mb.111cn.netmemberidmyaccessdb.mdb

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.