Win32::ODBC - Object
--------------------------------------------------------------------------------
Creating an ODBC Object
Your script will need to have the following line:
use Win32::ODBC;
调用模块
Then you will need to create a data connection to your DSN:
$Data = new Win32::ODBC("MyDSN");
数据源的连接
You shoud check to see if $Data is indeed defined otherwise there has been an error. You can now send SQL queries and retrieve info to your heart's content! See the description of functions below and also test.pl to see how it all works.
Make sure that you close your connection when you are finished:
$Data->Close();
关闭连接
--------------------------------------------------------------------------------
Object Methods
General Note
All methods assume that you have the line:
use Win32::ODBC;
somewhere before the method calls, and that you have an ODBC object called $db which was created using some call similar to:
$db = new Win32::ODBC("MyDSN");
See new for more information.
Also, in an effort to keep the examples short, no error checking is done on return values for any calls other than the one being exemplified. You should always check for error conditions in production code.
WARNING: The example code has not yet been tested. This will be fixed ASAP, but be forwarned!
Catalog qualifier, owner, name, type
Retrieves the catalog from the current ODBC object.
Returns a four-element array (Qualifier, Owner, Name, Type).
Note:All fieldnames are uppercase!
Example:
($qualifier, $owner, $name, $type) = $db->Catalog("", "", "%", "'TABLE'");
从库中检索数据到下面四个变量中(Qualifier, Owner, Name, Type)
Connection
Returns the object's ODBC connection number.
Example:
$cnum = $db->Connection;
建立连接
Close
Closes the ODBC connection for this object. It always returns undef.
Example: $db->Close();
- 2005-04-29关于ODBC数据源连接文本
- 2005-04-29ODBC文件DSN 的结构
- 2001-07-30在DELPHI程序中使用ADO对象存取ODBC数据库
- 2000-12-23用php和MySql来与ODBC数据连接
- 2005-04-24VC ODBC使用总结
- 2001-10-29在DELPHI程序中自动设置ODBC数据源
- 2001-10-29在DELPHI程序中使用ADO对象存取ODBC
- 2001-10-29在DELPHI程序中自动设置ODBC数据源
- 2006-07-21ODBC慨述
- 2001-05-21通过ODBC连接的SQL SERVER实例
热点搜索
热点文章






