UPDATE: DBP_TPC_SQLServer.zip
The SQL Server plugin has been posted on the site. The file is DBP_TPC_SQLServer.zip, located at the bottom of the page. It contains the dll, a document, and a keywords ini file. All feedback is welcome.
Sample DBP code.
You'll need to adjust your connection string to contain your workstation and/or SQL server machine names, and the database name. The code below is not a complete program so don't unrem the whole thing and expect to run it straight away. It's posted as a reference only.
iConn as integer
sConn as string
irows as integer
icols as integer
sConn = "workstation id=JAB-UBER2K;packet size=4096;" + _
"user id=sa;data source=JAB-UBER2K;" + _
"persist security info=False;initial catalog=Test"
sql_Init
iconn=sql_SetConnection(sConn)
print "conn=" + str$(iconn)
wait key
remstart
SQL_ClearParams
SQL_AddParam "@pval1", "param1"
SQL_AddParam "@pval2", "param2"
SQL_AddParam "@pval3", "param3"
`irows = SQL_RunSProc("sp_Insert3")
irows=sql_runstatement("insert into tbl_test(test1,test2,test3) values(@pval1,@pval2,@pval3)")
print "write db ok"
wait key
remend
`remstart
`irows = SQL_RunSProc("sp_GetAll")
irows = SQL_RunStatement("select * from tbl_Test where rid=3")
sCol0 as string
sCol1 as string
sCol2 as string
sCol3 as string
iLoop as integer
for iLoop=0 to iRows
sCol0=SQL_GetRowDataByColName(iLoop,"RID")
sCol1=SQL_GetRowDataByColName(iLoop,"Test1")
sCol2=SQL_GetRowDataByColName(iLoop,"Test2")
sCol3=SQL_GetRowDataByColName(iLoop,"Test3")
print scol0 + "|" + scol1 + "|" + scol2 + "|" + sCol3
next iLoop
print "read db ok"
print "rowsUB=" + str$(irows)
wait key
`remend
For this, or any of my other plugins, click the link in my sig.
(home of DBP_NETLIB, EZ_Serv(1.4 coming soon), EZS Tutorials for DBP, TCP/IP plugins, Database plugins)
DBP Plugins Latest: MSAccess, SQLServer, MySQL plugins for DBP