Delphi如何連MySQL? |
答題得分者是:loverlin
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
|
miga
初階會員 發表:61 回覆:92 積分:30 註冊:2002-08-27 發送簡訊給我 |
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
已知可用MyODBC工作的程式 來至http://www.cs.ccu.edu.tw/~lyj87u/MySQL_doc/manual_ODBC.html#Which_ODBC_OS Delphi
你必須使用DBE 3.2或更新。當與MySQL連接時,設置“Don't optimize column width”(不最 佳化列寬度)選項域。另外,有一些潛在有用的delphi代碼安裝一個ODBC入口和針對 MyODBC的一個BDE的入口(BDE入口需要一個BDE Alias Editor,可以到Delphi Super Page上免 費擁有):(感謝Bryan Brunton bryan@flesherfab.com)
fReg:= TRegistry.Create;
fReg.OpenKey('\Software\ODBC\ODBC.INI\DocumentsFab', True);
fReg.WriteString('Database', 'Documents');
fReg.WriteString('Description', ' ');
fReg.WriteString('Driver', 'C:\WINNT\System32\myodbc.dll');
fReg.WriteString('Flag', '1');
fReg.WriteString('Password', '');
fReg.WriteString('Port', ' ');
fReg.WriteString('Server', 'xmark');
fReg.WriteString('User', 'winuser');
fReg.OpenKey('\Software\ODBC\ODBC.INI\ODBC Data Sources', True);
fReg.WriteString('DocumentsFab', 'MySQL');
fReg.CloseKey;
fReg.Free; Memo1.Lines.Add('DATABASE NAME=');
Memo1.Lines.Add('USER NAME=');
Memo1.Lines.Add('ODBC DSN=DocumentsFab');
Memo1.Lines.Add('OPEN MODE=READ/WRITE');
Memo1.Lines.Add('BATCH COUNT=200');
Memo1.Lines.Add('LANGDRIVER=');
Memo1.Lines.Add('MAX ROWS=-1');
Memo1.Lines.Add('SCHEMA CACHE DIR=');
Memo1.Lines.Add('SCHEMA CACHE SIZE=8');
Memo1.Lines.Add('SCHEMA CACHE TIME=-1');
Memo1.Lines.Add('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
Memo1.Lines.Add('SQLQRYMODE=');
Memo1.Lines.Add('ENABLE SCHEMA CACHE=FALSE');
Memo1.Lines.Add('ENABLE BCD=FALSE');
Memo1.Lines.Add('ROWSET SIZE=20');
Memo1.Lines.Add('BLOBS TO CACHE=64');
Memo1.Lines.Add('BLOB SIZE=32'); AliasEditor.Add('DocumentsFab','MySQL',Memo1.Lines); --------------------------------------------------------------
看不懂,各位幫幫忙!!
|
jthwang
一般會員 發表:1 回覆:21 積分:4 註冊:2002-07-31 發送簡訊給我 |
|
loverlin
一般會員 發表:1 回覆:35 積分:22 註冊:2002-07-15 發送簡訊給我 |
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
Zeos Library Open Source
http://zeoslib.sourceforge.net/zeos_zdo_main.php Components for fast access to MySql, PostgreSql, MicrosoftSQL, Oracle and Interbase SQL servers without use add-ons, such as BDE / ODBC / ADO. Besides, the components - sources of data are compatible with standard TDataset and have a number of additional features. The library consists of: 1.Low-level plain API for access to client part of MySql, PostgreSql and Interbase
2.Low-level class API for access to MySql, PostgreSql and Interbase
3.TZXXSqlDatabase components for representation of database connection
4.TZXXSqlTransact components for transaction managment
5.TZXXSqlQuery components for executing of Sql-queries and viewing/editing of the contents of simple and complex selects.
6.TZXXSqlTable components for viewing and editing of database tables
7.TZXXSqlMonitor components for viewing of outgoing queries to SQL-servers
8.TZUpdateSql components for changing/deleting/adding of queries
9.TZBatchSql for executing of Sql-scripts Library download: zeosdbo-5.3.0-prebeta6.zip
http://zeoslib.sourceforge.net/download/zeosdbo-5.3.0-prebeta6.zip --------------------------------------------------------- 是不是這一個呢?
|
loverlin
一般會員 發表:1 回覆:35 積分:22 註冊:2002-07-15 發送簡訊給我 |
引言: Zeos Library Open Source http://zeoslib.sourceforge.net/zeos_zdo_main.php Components for fast access to MySql, PostgreSql, MicrosoftSQL, Oracle and Interbase SQL servers without use add-ons, such as BDE / ODBC / ADO. Besides, the components - sources of data are compatible with standard TDataset and have a number of additional features. The library consists of: 1.Low-level plain API for access to client part of MySql, PostgreSql and Interbase 2.Low-level class API for access to MySql, PostgreSql and Interbase 3.TZXXSqlDatabase components for representation of database connection 4.TZXXSqlTransact components for transaction managment 5.TZXXSqlQuery components for executing of Sql-queries and viewing/editing of the contents of simple and complex selects. 6.TZXXSqlTable components for viewing and editing of database tables 7.TZXXSqlMonitor components for viewing of outgoing queries to SQL-servers 8.TZUpdateSql components for changing/deleting/adding of queries 9.TZBatchSql for executing of Sql-scripts Library download: zeosdbo-5.3.0-prebeta6.zip http://zeoslib.sourceforge.net/download/zeosdbo-5.3.0-prebeta6.zip --------------------------------------------------------- 是不是這一個呢?是~ 他還是一些其他的工具(zde)跟元件(zeosctrl) 你可以一些下載來用 基本上他跟 Indy 是我目前使用起來最好用又實的&不花$$的好元件 kk-boy
------
kk-boy |
bookworm
中階會員 發表:63 回覆:161 積分:82 註冊:2002-08-03 發送簡訊給我 |
|
loverlin
一般會員 發表:1 回覆:35 積分:22 註冊:2002-07-15 發送簡訊給我 |
引言: 對不起,請問一下這該怎麼裝? 我點了mysql的package時,delphi跳出一個視窗說: This package appears to be in an older format. Would you like to convert it to the new format? 我該選yes還是no?這是正常的嗎? 對不起,第一次裝其它的component,沒經驗。你選 yes 就好了~ 那是因為他的 *.dpk 格式比較舊,所以要轉換。 在解壓縮後有個 examples 的目錄,有一些範例,你可以看一下。 kk-boy
------
kk-boy |
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
MySQL資料庫可視化管理工具 下載請至:
http://delphi.ktop.com.tw/topic.php?TOPIC_ID=22655 「好用喔!Q~~」
|
bookworm
中階會員 發表:63 回覆:161 積分:82 註冊:2002-08-03 發送簡訊給我 |
WINDOWS INSTALL
1. Unpack the archive with components 2. Copy libmysql.dll and/or libpq.dll into
your Windows/System directory 3. Edit Zeos.inc file. You may set there you language,
maximum quantity of supported memo fields, etc. 4. Add to Delphi Library Path pathes to XXX, XXX\common, XXX\dbase,
where XXX - ZeosDBO directory. 5. Compile and install library in Delphi 3.0, 4.0, 5.0 and
C Builder 4.0 with the same version of dpk file.
Install dpk files in the next sequence:
ZCommonXXX, ZDbwareXXX, { ZMySqlXXX | ZPgSqlXXX | ZIbSqlXXX
| ZMsSqlXXX | ZOraSqlXXX } 對不起,我看了第四點,還是看不懂。Delphi library path在哪?該怎麼
加入ZeosDBO下的common跟dbase呢?煩請指點!
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
引言: WINDOWS INSTALL 1. Unpack the archive with components 2. Copy libmysql.dll and/or libpq.dll into your Windows/System directory 3. Edit Zeos.inc file. You may set there you language, maximum quantity of supported memo fields, etc. 4. Add to Delphi Library Path pathes to XXX, XXX\common, XXX\dbase, where XXX - ZeosDBO directory. 5. Compile and install library in Delphi 3.0, 4.0, 5.0 and C Builder 4.0 with the same version of dpk file. Install dpk files in the next sequence: ZCommonXXX, ZDbwareXXX, { ZMySqlXXX | ZPgSqlXXX | ZIbSqlXXX | ZMsSqlXXX | ZOraSqlXXX } 對不起,我看了第四點,還是看不懂。Delphi library path在哪?該怎麼 加入ZeosDBO下的common跟dbase呢?煩請指點!意思是說:將以下存放Zeos元件的路徑告訴給Delphi, 例如:[依據放置位置設好這三個路徑] c:\Program Files\Borland\Delphi6\ExLib\zeosdbo\ c:\Program Files\Borland\Delphi6\ExLib\zeosdbo\common c:\Program Files\Borland\Delphi6\ExLib\zeosdbo\dbase 將以上加到Delphi中, Tools-->Evironment options-->Library-->Library path 放在此即可! 發表人 - flyup 於 2002/11/04 22:21:56 |
bookworm
中階會員 發表:63 回覆:161 積分:82 註冊:2002-08-03 發送簡訊給我 |
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
引言: 謝謝你,我應該把問題一次問完的。 第四點沒問題了,可是怎麼樣compile 跟install這些dpk呢? 是不是先選zeosdbo下的zcommon3、zcommon4 ...到zcommonk這樣? 還是我用錯方法了?你用錯方法了!加油! ------------------------------------------------------ 應該是File-->Open-->c:\Program Files\Borland\Delphi6\ExLib\zeosdbo\ 「舉例位置」-->{依序開啟ZCommon6, ZDbware6, { ZMySql6 | ZPgSql6 | ZIbSql6| ZMsSql6 | ZOraSql6 }...dpk檔[表示要給Delphi 6版本使用的]} 簡言之:做完第一個ZCommon6.dpk-->Compile-->install -->在做第二個ZDbware6.dpk......[依此類推] |
bookworm
中階會員 發表:63 回覆:161 積分:82 註冊:2002-08-03 發送簡訊給我 |
我也照這麼做啦,還是出現錯誤訊息:
Cannot load package 'ZCommon6.' It contains unit Ztoken,which is also contained in package 'dclusr60'
我哪裡做錯了?
1、解壓縮
2、將兩個檔copy到windows/system下
3、這我沒動,不知道要改什麼
4、將三個路徑加到library的path
5、compile and install那幾個檔
我在compile的時候沒問題,在install時就出現這個錯誤了
我的是delphi6 update 2,winxp
可以幫我看看嗎?謝謝!
|
flyup
資深會員 發表:280 回覆:508 積分:385 註冊:2002-04-15 發送簡訊給我 |
引言: 我也照這麼做啦,還是出現錯誤訊息: Cannot load package 'ZCommon6.' It contains unit Ztoken,which is also contained in package 'dclusr60' 我哪裡做錯了? 1、解壓縮 2、將兩個檔copy到windows/system下 3、這我沒動,不知道要改什麼 4、將三個路徑加到library的path 5、compile and install那幾個檔 我在compile的時候沒問題,在install時就出現這個錯誤了 我的是delphi6 update 2,winxp 可以幫我看看嗎?謝謝!解決方法: 1.另外拷貝 libmysql.dll 及 libpq.dll 到 Windows/System32 資料夾 2.若之前ZCommon6.dpk封裝時,有產生之錯誤,建議到C:\Program Files\Borland\Delphi6\Projects\Bpl,找一下ZCommon6.BPL檔先行刪除, 再重新對元件做Compile-->install。 |
bookworm
中階會員 發表:63 回覆:161 積分:82 註冊:2002-08-03 發送簡訊給我 |
|
adam
一般會員 發表:5 回覆:20 積分:5 註冊:2002-03-12 發送簡訊給我 |
|
adam
一般會員 發表:5 回覆:20 積分:5 註冊:2002-03-12 發送簡訊給我 |
|
degr
一般會員 發表:22 回覆:36 積分:21 註冊:2002-03-25 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |