Oracle11g 如何在foxpro9上连接Oracle数据库11g服务器

Oracle11g 如何在foxpro9上连接Oracle数据库11g服务器,oracle11g,visual-foxpro,Oracle11g,Visual Foxpro,如何在FoxPro中连接远程oracle database 11g服务器?如果您安装了数据提供程序,则应该相对简单 这样,您就可以通过 cConnectionString = "Driver = blah;Server=blah; etc from connection string website reference"; nHandle = SQLStringConnect( cConnectionString ) if nHandle < 1 messagebox( "Unab

如何在FoxPro中连接远程oracle database 11g服务器?

如果您安装了数据提供程序,则应该相对简单

这样,您就可以通过

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)
参数几乎可以是任何类型,除了像general/binary这样可能需要替代度量的东西,但是其他的像logical、numeric、date、string都没有问题