Scripts and Examples
2004-06-29 15:00
591 查看
ASP Scripts | ||
¤ | ODBC DSN Connection String: | |
oConn.Open "DSN=mySystemDSN" | ||
¤ | DSN-Less Connection String for .mdb file: | |
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(".") & "/myDb.mdb;User Id=admin;Password=" | ||
¤ | DSN-Less Connection String for Excel page: | |
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/somepath/mySpreadsheet.xls;Extended Properties=""Excel 8.0;HDR=Yes""" ' Where "HDR=Yes" means that there is a header row in the cell range ' (or named range), so the provider will not include the first row of the ' selection into the recordset. If "HDR=No", then the provider will include ' the first row of the cell range (or named ranged) into the recordset. | ||
¤ | DSN-Less Connection String to a text file: | |
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/somepath/;Extended Properties=""text;HDR=Yes;FMT=Delimited""" ' Then open a recordset based on a select on the actual file oRs.Open "Select * From MyTextFile.txt", oConn, adOpenStatic, adLockReadOnly, adCmdText | ||
¤ | Connection to MS SQL database: | |
oConn.open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=USERNAME;Initial Catalog=DATABASE;Data Source=QUICK;password=PASSWORD" | ||
¤ | Connection to MySQL Database: | |
oConn.open "Provider=MSDASQL; DRIVER={MySQL ODBC 3.51 Driver}; Server=HOST; UID=USERNAME; PWD=PASSWORD; database=DATABASE; Option=16387" | ||
PhP Scripts | ||
¤ | DSN Connection String: | |
# connect to a DSN "mydb" with a user and password "marin" $connect = odbc_connect("mydb", "marin", "marin"); | ||
¤ | DSN-Less Connection String for .mdb: | |
$db = ADONewConnection('access'); $dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=d:/inetpub/adodb/northwind.mdb;Uid=Admin;Pwd=;"; $db->Connect($dsn); | ||
¤ | DSN-Less Connection String for MS SQL Server: | |
$db = ADONewConnection('odbc_mssql'); $dsn = "Driver={SQL Server};Server=localhost;Database=northwind;"; $db->Connect($dsn,'userid','password'); | ||
¤ | Connection to MySQL: | |
function connect() { mysql_connect("IP/SERVER","USERNAME","PASSWORD") or die("Problem DataBase Connection"); mysql_select_db("DATABASENAME") or die("Could not select database"); } |
相关文章推荐
- CALL RFC synchronize and asychronize Examples
- SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
- Applying Domain-Driven Design and Patterns(ADDDP) With examples in C# and .NET
- Nginx rewrite URL examples with and without redirect address
- 【索引】Geometric Computations and Algorithms in 3D::Examples
- #“Machine Learning”(Andrew Ng)#Week 4_3:Examples and Intuition I
- TensorFlow Inception, ResNet, VGG net and more examples (TensorFlow 例子集合)
- Embedding Greek and scripts into text IDL
- ASP.NET MVC Sample Applications - Open-Source Examples and Tutorials
- Here I put nontrivial MOLPRO scripts, which I found useful for me and other:
- Hexo-blogs-to-add-search-and-the-python-scripts-record-automatically
- bash Cookbook: Solutions and Examples for bash Users
- Applying Domain-Driven Design and Patterns(ADDDP) With examples in C# and .NET
- OneNote and Autohotkey – Useful Scripts
- Pre-Update and Pre-Insert Trigger Examples For Oracle Forms
- How to Build and Run Android NDK Examples?
- CALL RFC synchronize and asychronize Examples
- Qt5 的 examples and demos
- Active learning by querying informative and representative examples
- CSS selectors difference and examples