vilian wrote:Yes, you can. Are you using maria01.prg by this way?
oCn := maria_Connect( aStr[ 1 ], .t. )
What is aStr's content ? I think your content is out of date.
Thank you, maria01.prg it was old.
vilian wrote:Yes, you can. Are you using maria01.prg by this way?
oCn := maria_Connect( aStr[ 1 ], .t. )
What is aStr's content ? I think your content is out of date.
If .not. File( cDefa+"\Rick.mdb" )
Ferase( cDefa+"\Rick.mdb" )
// create the adox object
Try
catNewDB := CreateObject("ADOX.Catalog")
Catch
MsgInfo( "Could not Create ADOX object")
Return(.f.)
End try
// create the table Rick.mdb
Try
catNewDB:Create('Provider='+xProvider+';Data Source='+xSource+';Jet OLEDB:Engine Type=5' )
Catch
MsgInfo( "Could not create the table "+xSource )
Return(.f.)
End Try
Try
oCn := CREATEOBJECT( "ADODB.Connection" )
Catch
MsgInfo( "Could not create the ADO object for connection")
End Try
TRY
oCn:Open( xCONNECT )
CATCH oErr
MsgInfo( "Could not open a Connection to Database "+xSource )
RETURN(.F.)
END TRY
cSQL := "CREATE TABLE CUSTOMER"
cSQL += "( "
cSQL += "[CUSTOMEREID] char(18) NOT NULL, "
cSQL += "[LAST NAME] char(30) NULL, "
cSQL += "[FIRST NAME] char(30) NULL, "
cSQL += "[MID INIT] char(30) NULL, "
cSQL += "[ADDRESS1] char(30) NULL, "
cSQL += "[CITY] char(30) NULL, "
cSQL += "[STATE] char(30) NULL, "
cSQL += "CONSTRAINT PK_USERINFO PRIMARY KEY ( CUSTOMEREID )"
cSQL += " )"
Try
oCn:Execute( cSQL )
Catch
MsgInfo( "Table CUSTOMER Failed" )
Return(.f.)
End try
oCn:Close()
oCn := nil
Endif
xLOGIN := UPPER( WNetGetuser() )+space(8) // fivewin
xLOGIN := SUBSTR(xLOGIN,1,8)
oRsCust := TOleAuto():New( "ADODB.Recordset" )
oRsCust:CursorType := 1 // opendkeyset
oRsCust:CursorLocation := 3 // local cache
oRsCust:LockType := 3 // lockoportunistic
// check for very first user
cSQL := "SELECT * FROM CUSTOMER"
TRY
oRsCust:Open( cSQL, xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening CUSTOMER table here" )
RETURN(.F.)
END TRY
If oRsCust:eof
oRsCust:AddNew()
oRsCust:Fields("CustomerEid"):Value := "011111111111111111"
oRsCust:Fields("Last Name"):Value := "Lipkin"
oRsCust:Fields("First Name"):Value := "Richard"
oRsCust:Fields("Mid Init"):Value := "M"
oRsCust:Fields("Address1"):Value := "123 Anywhere"
oRsCust:Fields("City"):Value := "Columbia"
oRsCust:Fields("State"):Value := "SC"
oRsCust:Update()
oRsCust:AddNew()
oRsCust:Fields("CustomerEid"):Value := "011111111111111112"
oRsCust:Fields("Last Name"):Value := "Lipinsky"
oRsCust:Fields("First Name"):Value := "Jason"
oRsCust:Fields("Mid Init"):Value := "S"
oRsCust:Fields("Address1"):Value := "123 Arborgate"
oRsCust:Fields("City"):Value := "Columbia"
oRsCust:Fields("State"):Value := "SC"
oRsCust:Update()
oRsCust:AddNew()
oRsCust:Fields("CustomerEid"):Value := "011111111111111113"
oRsCust:Fields("Last Name"):Value := "Lipkin"
oRsCust:Fields("First Name"):Value := "Beth"
oRsCust:Fields("Mid Init"):Value := " "
oRsCust:Fields("Address1"):Value := "123 Lake Murray Blvd"
oRsCust:Fields("City"):Value := "Lexington"
oRsCust:Fields("State"):Value := "SC"
oRsCust:Update()
oRsCust:AddNew()
oRsCust:Fields("CustomerEid"):Value := "011111111111111114"
oRsCust:Fields("Last Name"):Value := "Lizzarous"
oRsCust:Fields("First Name"):Value := "Tim"
oRsCust:Fields("Mid Init"):Value := "J"
oRsCust:Fields("Address1"):Value := "456 Broad River"
oRsCust:Fields("City"):Value := "Irmo"
oRsCust:Fields("State"):Value := "SC"
oRsCust:Update()
Endif
// you can add many more records to the Customer table here. The CustomerEID field is the primary key and unique.
I have clear ideas on how a database should be for my purposes and have delved deeply into it. I like the DBF system, which for me is practically just a directory.
If you observe how people organize their data on the hard drive or desktop, you can see what is needed. A rigid framework is not ideal.
wartiaga wrote:nageswaragunupudi wrote:Please use this revised maria01.prg
- Code: Select all Expand view RUN
#include "fivewin.ch"
REQUEST DBFCDX
static aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
"209.250.245.152,fwh,fwhuser,FiveTech@2022" }
static oCn
function Main()
local aTables
SET DATE ITALIAN
SET CENTURY ON
FW_SetUnicode( .t. )
CursorWait()
oCn := maria_Connect( aStr[ 1 ], .t. )
aTables := oCn:ListTables()
XBROWSER oCn:ListTables() ;
TITLE "Dbl-Click to View Table" ;
SHOW RECID ;
SETUP ( ;
oBrw:aCols[ 1 ]:bLDClickData := { |r,c,f,o| ShowTable( o:Value ) }, ;
oBrw:bDropFiles := { |aFiles| xbrowse( aFiles ) } )
oCn:Close()
return nil
function ShowTable( cTable )
local oRs, nSecs := SECONDS()
if cTable == "custbig"
MsgRun( "Reading " + cTable, "Please wait", { || oRs := oCn:RecSet( cTable, -100 ) } )
else
MsgRun( "Reading " + cTable, "Please wait", { || oRs := oCn:RowSet( cTable ) } )
endif
nSecs := SECONDS() - nSecs
XBROWSER oRs TITLE cTable + " (" + cValToChar( nSecs ) + ") seconds" ;
FASTEDIT NOMODAL SHOW RECID
return nil
You can try with mysqlclient.lib
echo %fwh%\lib\FiveH32.lib %fwh%\lib\FiveHC32.lib %fwh%\lib\libmysql32.lib >> msvc.tmp
echo %fwh%\lib\FiveH32.lib %fwh%\lib\FiveHC32.lib %fwh%\lib\mysqlclient.lib >> msvc.tmp
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 48 guests