1
如何在FoxPro中連接遠程oracle數據庫11g服務器?如何在FoxPro上連接Oracle數據庫11g服務器9
如何在FoxPro中連接遠程oracle數據庫11g服務器?如何在FoxPro上連接Oracle數據庫11g服務器9
只要您安裝了數據提供程序,它應該相對簡單。
I would start by looking at the connection string requirements
有了這一點,你可以通過
cConnectionString = "Driver = blah;Server=blah; etc from connection string website reference";
nHandle = SQLStringConnect(cConnectionString)
if nHandle < 1
messagebox("Unable to connect")
return
endif
*/ Once connected, you can then query the database
nResult = SQLExec(nHandle, "select * from yourTable", "cursorResultSentBackToVFPSide")
if nResult < 1
messagebox("Error querying data")
return
endif
*/ If you need to parameterize something, a local variable in your routine can be used
*/ and will be applied by using the "?" place-holder, such as
lnSomeIDYouWant = 1234
lcSQLCmd = "select * from SomeTable where SomeKey = ?lnSomeIDYouWant order by blah"
nResult = SQLExec(nHandle, lcSQLCmd, "C_VFPAlias")
SQLDisconnect(nHandle)
參數得到一個處理數據庫幾乎可以是任何類型的(除了對於像普通/二進制文件,可能需要替代措施,但其他人喜歡邏輯,數字,日期,字符串都沒有問題)。