FirebirdSQL/5/5
出自VFP Wiki
(修訂版本間差異)
小 (revert) |
NorolLetob (對話 | 貢獻) |
||
第1行: | 第1行: | ||
+ | * [http://chitrocva.com/drongetvar.html conocnavid] | ||
+ | http://tacnac.com/cnac4traca.html[conocnavid] [[http://tacnac.com/cnac4traca.html][conocnavid]] | ||
+ | * http://noelcos.com/trnoala.html conocnavid | ||
+ | * [[http://elteld.com/cadarnol.html conocnavid]] | ||
+ | * [[http://lirelboc.com/vilire.html|conocnavid]] | ||
+ | * [[http://varbaspas.com/zelcnad.html | conocnavid]] | ||
+ | * [http://bonori.com/olodela.html|conocnavid] | ||
+ | * [conocnavid|http://relgetrolbo.com/eltlirelt.html] | ||
+ | * ((http://ricdar.com/alsitalo.html conocnavid)) | ||
+ | * [conocnavid](http://aldarrel.com/oloviboelcn.html "conocnavid") | ||
+ | "conocnavid":http://coorbasrac.com/pasrolviba.html | ||
+ | |||
=== VB Code === | === VB Code === | ||
- | + | 以ä¸ç¨å¼ä¾èªæ¼[http://home.pacbell.net/cetta/VB-Firebird-SAP.html VB Programming with Firebird]ï¼ | |
- | * | + | *åå¾ææè³æ |
<pre> | <pre> | ||
FB-Connecting.vbp | FB-Connecting.vbp | ||
第26行: | 第38行: | ||
End Sub | End Sub | ||
</pre> | </pre> | ||
- | * | + | *æ´æ°å®çè³æ |
<pre> | <pre> | ||
Text1 = txtEStateCode | Text1 = txtEStateCode | ||
第56行: | 第68行: | ||
End Sub | End Sub | ||
</code> | </code> | ||
- | * | + | *æ°å¢å®çè¨é |
<code> | <code> | ||
Private Sub cmdAdd_Click() | Private Sub cmdAdd_Click() | ||
第79行: | 第91行: | ||
End Sub | End Sub | ||
</pre> | </pre> | ||
- | * | + | *æ°å¢å¤çè¨é |
<pre> | <pre> | ||
Private Sub cmdAdd_Click() | Private Sub cmdAdd_Click() | ||
第119行: | 第131行: | ||
End Sub | End Sub | ||
</pre> | </pre> | ||
- | * | + | *使ç¨Stored Procedure |
<pre> | <pre> | ||
- | /* | + | /*以ä¸çºFirebirdSQL çCreating a Stored Procedure*/ |
Create Procedure SP_GETLIST | Create Procedure SP_GETLIST | ||
第137行: | 第149行: | ||
END | END | ||
- | ' | + | '以ä¸çºVB Code |
Private Sub Command1_Click() | Private Sub Command1_Click() | ||
第161行: | 第173行: | ||
</pre> | </pre> | ||
- | === VB& | + | === VB&Firebirdæç« === |
*[http://home.pacbell.net/cetta/VB-Firebird-SAP.html VB Programming with Firebird] | *[http://home.pacbell.net/cetta/VB-Firebird-SAP.html VB Programming with Firebird] | ||
*[http://www.ibphoenix.com/downloads/OdbcJdbc_ExamplesAdo.zip Examples Using ADO (VB)] | *[http://www.ibphoenix.com/downloads/OdbcJdbc_ExamplesAdo.zip Examples Using ADO (VB)] | ||
- | === | + | === VBåèç¶²ç« === |
- | [http://www.hosp.ncku.edu.tw/~cww/oldguy/oldguy.htm | + | [http://www.hosp.ncku.edu.tw/~cww/oldguy/oldguy.htm èæªä¹VBåç´ç] |
在2009年8月19日 (三) 10:41所做的修訂版本
http://tacnac.com/cnac4traca.html[conocnavid] [[1][conocnavid]]
- http://noelcos.com/trnoala.html conocnavid
- [conocnavid]
- [[2]]
- [| conocnavid]
- [3]
- [conocnavid|http://relgetrolbo.com/eltlirelt.html]
- ((http://ricdar.com/alsitalo.html conocnavid))
- [conocnavid](http://aldarrel.com/oloviboelcn.html "conocnavid")
"conocnavid":http://coorbasrac.com/pasrolviba.html
VB Code
以ä¸ç¨å¼ä¾èªæ¼VB Programming with Firebirdï¼
- åå¾ææè³æ
FB-Connecting.vbp Private sub Command1_Click() Dim cn As New ADODB.Connection Dim rs As New Recordset Dim sql As String cn.ConnectionString = "Provider=ZStyle IBOLE Provider; Data Source = "_&"c:\ProgramFiles\Firebird\Firebird_1_5\Samples\Httplogs.gdb;UID=sysdba;password= pwd" cn.Open sql= "Select* From States" Set rs = cn.Execute(sql) DoWhile Not rs.EOF List1.AddItemrs(0) & vbTab & rs(1) rs.MoveNext Loop rs.Close cn.Close End Sub
- æ´æ°å®çè³æ
Text1 = txtEStateCode Text2 = txtEStateName Command1 = cmdEdit Command2 = cmdAdd Private Sub cmdEdit_Click() Dim cn1 As New ADODB.Connection Dim sql As String If txtEStateCode = "" Then MsgBox "Please enter a State Code!": _ txtEStateCode.SetFocus: Exit Sub cn1.ConnectionString = "Provider=ZStyle IBOLE Provider; Data Source=" _ & "c:\Program Files\Firebird\Firebird_1_5\Samples\Httplogs.gdb; UID=sysdba; password=pwd" cn1.Open sql = "Update States Set State_Name='" & txtEStateName & "'" & _ & " Where State_Code='" & UCase(txtEStateCode) & "'" cn1.Execute sql cn1.Close txtEStateCode = "" txtEStateName = "" End Sub </code> *æ°å¢å®çè¨é <code> Private Sub cmdAdd_Click() Dim cn As New ADODB.Connection Dim sql As String If txtEStateCode = "" Then MsgBox "Please enter a State Code!": _ txtEStateCode.SetFocus: Exit Sub cn.ConnectionString = "Provider=ZStyle IBOLE Provider; Data Source=" _ & "c:\Program Files\Firebird\Firebird_1_5\Samples\Httplogs.gdb; UID=sysdba; password=pwd" cn.Open sql = "Insert Into States (State_Code, State_Name) Values" _ & "('" & UCase(txtEStateCode) & "','" & txtEStateName & "')" cn.Execute sql cn.Close txtEStateCode = "" txtEStateName = "" End Sub
- æ°å¢å¤çè¨é
Private Sub cmdAdd_Click() Dim cn As New ADODB.Connection Dim sql As String Dim i, rowCount As Integer Dim lineItem As String Dim itemArray cn.ConnectionString = "Provider=ZStyle IBOLE Provider; Data Source=" _ & "c:\Program Files\Firebird\Firebird_1_5\Samples\Httplogs.gdb; UID=sysdba; password=pwd" cn.Open 'Add items to database rowCount= List1.ListCount 'getthe number of rows in the list box Do Until i = rowCount lineItem = List1.List(i) itemArray = Split(lineItem, vbTab) sql = "Insert Into States (State_Code, State_Name) Values" _ & "('" & UCase(itemArray(0)) & "','" & itemArray(1) & "')" i = i + 1 cn.Execute sql Loop cn.Close List1.Clear End Sub Sub Private Sub Form_Load() List1.AddItem "CO" & vbTab & "Colorado" List1.AddItem "CT" & vbTab & "Connecticut" List1.AddItem "MN" & vbTab & "New Mexico" List1.AddItem "WY" & vbTab & "Wyoming" End Sub
- 使ç¨Stored Procedure
/*以ä¸çºFirebirdSQL çCreating a Stored Procedure*/ Create Procedure SP_GETLIST BEGIN SELECT State_Code, State_Name FROM States Where State_Code = 'VA' INTO :State_Code, :State_Name; SUSPEND; END '以ä¸çºVB Code Private Sub Command1_Click() Dim cn As New ADODB.Connection Dim cmd As ADODB.Command cn.ConnectionString = "Provider=ZStyle IBOLE Provider; Data Source=" _ & "c:\Program Files\Firebird\Firebird_1_5\Samples\Httplogs.gdb; UID=sysdba; password=pwd" cn.Open Set cmd = New ADODB.Command cmd.ActiveConnection = cn cmd.CommandText = "SP_GETLIST" cmd.CommandType = adCmdStoredProc cmd.Execute Text1 = cmd.Parameters(0).Value Text2 = cmd.Parameters(1).Value cn.Close End Sub