关于建立ODBC连接的问题,急!!! 一定要用odbc吗?控制面板--数据源建议使用oledb 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sorry,是我没说清楚,ODBC我已经建好了,我是想在程序里与这个ODBC的建立连接。用其他访问access数据库也可以,谢谢! 其实.net已经不对odbc进行支持了,只是为了兼容以前的版本才有连接可用,但是要从.net中创建还是用oledb吧,很简单的,按照向导做就好。 odbc还是可以用的,给你一些参考!Driver={SQL Server};Server=MyServer;UID=sa;PWD=sqLs$5xr;Database=Northwind;Driver={Microsoft ODBC for Oracle};Server=ORACLE8i7;UID=odbcuser;PWD=odbc$5xrDriver={Microsoft Access Driver (*.mdb)};DBQ=c:\bin\nwind.mdbDriver={Microsoft Excel Driver (*.xls)};DBQ=c:\bin\book1.xlsDriver={Microsoft Text Driver (*.txt; *.csv)};DBQ=c:\binDSN=dsnname 注意:ODBC只可以在.netFramework 1.1中才可以使用 但是帮助里那个连接数据库的ConnectionString是不是不对呀,我照他的写系统老提示“无法识别的转移序列”,这是为什么?? 麻烦你们能不能给我一个完整的连接Access的代码样例,谢谢! 1.set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")DBPath = Server.MapPath("customer.mdb")dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath SQL="select * from auth where id="" & user_id &""" SET uplist=dbconnection.EXECUTE(SQL)2. set dbconnection=Server.CreateObject("ADODB.Connection") DBPath = Server.MapPath("customer.mdb") dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath SQL="select * from auth where id="" & user_id &""" SET uplist=dbconnection.EXECUTE(SQL)3. DBPath = Server.MapPath("customer.mdb") set session("rs")=Server.CreateObject("ADODB.Recordset")" rs=Server.CreateObject("ADODB.Recordset") connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath SQL="select * from auth where id="" & user_id &""" session("rs").Open sql,connstr,1,34.建odbc源xxxset conn=server.createobject("Adodb.connection")conn.open "DSN=xxx;UID=;PWD=;Database=customer string DBPath = Server.MapPath("customer.mdb"); string myConnection = "driver={Microsoft Access Driver (*.mdb)};dbq=" + DBPath; OdbcConnection myConn = new OdbcConnection(myConnection); string myInsertQuery = "INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')"; OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery); myOdbcCommand.Connection = myConn; myConn.Open(); myOdbcCommand.ExecuteNonQuery(); myOdbcCommand.Connection.Close(); //如果是查询。用相应的OdbcDataReader读取即可 怎么判断某个年月日在本星期内?? asp.net如何连接access数据库??? 网站运行一会出错 求一个web播放器! 动态生成文件夹 (C#) 急 谢谢! 急阿 !!!DataGrid中添加按钮列的单击传值问题??在线等!!!! 创建新SQLServer数据库是灰色的 在CALENDAR中怎样使特定的日期底色为红??????? 来阿,来阿,菜菜问题,散分~~~~~ 如何控制DataGrid中每列的宽度? asp.net中有没有模板之类的东西? 前台如何读取数据库表中的某个子段值?
用其他访问access数据库也可以,谢谢!
Driver={Microsoft ODBC for Oracle};Server=ORACLE8i7;UID=odbcuser;PWD=odbc$5xr
Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\bin\nwind.mdb
Driver={Microsoft Excel Driver (*.xls)};DBQ=c:\bin\book1.xls
Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=c:\bin
DSN=dsnname
“无法识别的转移序列”,这是为什么??
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SQL="select * from auth where id="" & user_id &"""
SET uplist=dbconnection.EXECUTE(SQL)2.
set dbconnection=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("customer.mdb")
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id="" & user_id &"""
SET uplist=dbconnection.EXECUTE(SQL)3.
DBPath = Server.MapPath("customer.mdb")
set session("rs")=Server.CreateObject("ADODB.Recordset")
" rs=Server.CreateObject("ADODB.Recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from auth where id="" & user_id &"""
session("rs").Open sql,connstr,1,34.
建odbc源xxx
set conn=server.createobject("Adodb.connection")
conn.open "DSN=xxx;UID=;PWD=;Database=customer
string DBPath = Server.MapPath("customer.mdb");
string myConnection = "driver={Microsoft Access Driver (*.mdb)};dbq=" + DBPath;
OdbcConnection myConn = new OdbcConnection(myConnection);
string myInsertQuery = "INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')";
OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery);
myOdbcCommand.Connection = myConn;
myConn.Open();
myOdbcCommand.ExecuteNonQuery();
myOdbcCommand.Connection.Close(); //如果是查询。用相应的OdbcDataReader读取即可