Buenos dias,
Alguien tendra un ejemplo de como crear base de datos y tablas con la Tdatarow?
oCn := FW_OpenAdoConnection( { "MSSQL", "PCNAME\SQLEXPRESS",,"SA","secret" }, .t. )
if oCn == nil
? "Connect Fail"
return nil
endif
// proceed using the connection.
// Create a database named FWH
oCn:Execute( "CREATE DATABASE FWH" )
oCn:Close()
oCn := FW_OpenAdoConnection( { "MSSQL", "PCNAME\SQLEXPRESS","FWH","SA","secret" }, .t. )
if oCn == nil
? "Connect Fail"
return nil
endif
FW_AdoImportFromDBF( oCn, "c:\fwh\samples\customer.dbf" )
oRs := FW_OpenRecordSet( oCn, "customer" )
XBROWSER oRs FASTEDIT
oRs:Close()
oCn:Close()
It is possible to create a wrapper function instead to write Fw_OpenAdoConnection to call it ?
FWAdoCreateTable( "sales", { { BILLNO, 'N', 5, 0 }, ;
{ "DETAIL", "C", 20, 0 }, ;
{ "QTY", "N", 5, 0 }, ;
{ "RATE", "N", 5, 2 }, ;
{ "AMOUNT", "N", 12,2 } }, oCn )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 8 guests