ich entwickele gerade für einen Kunden ein CRM Modul - - Datenbank dbf foxpro - es werden einfach keine Indexdateien erstellt, wenn ich die Funktion auslöse
das hier ist die Funktion
Code: Alles auswählen
include "xbp.ch"
#Define CRLF Chr(13)+ Chr(10)
Function Index(oDlg)
Local oStatic, cAlleText, cText, oStatic1
FileDelete("*.cdx")
oStatic1 := XbpStatic():new( oDlg,, {50, 70}, {450, 30} )
oStatic1:options := XBPSTATIC_TEXT_CENTER
oStatic1:setFontCompoundName( "16.Arial" )
oStatic1:Create()
cText:="Indexaufbau für Datenbank: "
cAlleText:=""
cAlleText+="Die Indexverzeichnisse Ihrer Datenbanken werden jetzt neu aufgebaut;"
cAlleText+="Dies kann, je nach Größe Ihres Datenbestandes etwas Zeit in Anspruch nehmen !;"
cAlleText+=" Bitte warten Sie, bis diese Anzeige gelöscht wird und schalten Sie Ihre Maschine auf keinen Fall aus !"
oStatic := XbpStatic():new( oDlg,, {50, 250}, {400, 150} )
oStatic:options := XBPSTATIC_TEXT_CENTER + ;
XBPSTATIC_TEXT_WORDBREAK
oStatic:caption := StrTran( cAlleText, ";", Chr(13) )
oStatic:setFontCompoundName( "14.Arial" )
oStatic:Create()
If !Netz_Use("Gruppe.Dbf",.t.)
Quit
oStatic1:caption:=(cText+"GRUPPE")
oStatic1:configure()
Index on lower(alltrim(name)) tag "name" to "gruppe.cdx"
Endif
If !Netz_Use("Adr.Dbf",.t.)
Quit
oStatic1:caption:=(cText+"ADR")
oStatic1:configure()
Index on kdnr tag "kdnr" to "adr.cdx"
EndIf
If !Netz_Use("Produkt.Dbf",.t.)
Quit
oStatic1:caption:=(cText+"PRODUKT")
oStatic1:configure()
Index on lower(alltrim(name)) tag "name" to "produkt.cdx"
EndIf
If !Netz_Use("Rechnung.Dbf",.t.)
Quit
oStatic1:caption:=(cText+"RECHNUNG")
oStatic1:configure()
Index on kdnr tag "kdnr" to "rechnung.cdx"
EndIf
oStatic1:destroy()
oStatic:destroy()
Close Data
msgbox("Der Indexaufbau ist beendet!")
Return Nil
das hier ist die Netz_use - welche prüft, ob die Datenbank Exclusive zu öffnen ist.
Code: Alles auswählen
#Define CRLF Chr(13)+ Chr(10)
Function Netz_Use()
Local lJa:=.f.
PARAMETERS Datei, ex_use, cTitel, Info, Name
If Info="alias"
If ex_use && exclusive
Use &Datei New Exclusive Alias Name
EndIf
Else
If ex_use && exclusive
Use &Datei New Exclusive
EndIf
EndIf
If NetErr()
lJa:=.f.
Msgbox("Die Datenbank "+Datei+" ist in Benutzung"+CRLF+;
"Das Programm an allen Stationen beenden und erneut starten",cTitel)
Else
lJa:=.t.
EndIf
Return lJa
Code: Alles auswählen
PROCEDURE DbeSys
#include "DbfDbe.ch"
#include "Dmlb.Ch"
IF ! DbeLoad( "FOXDBE", .T.)
Alert( "Database-Engine FOXDBE nicht geladen", {"OK"} )
ENDIF
IF ! DbeLoad( "CDXDBE", .T.)
Alert( "Database-Engine CDXDBE nicht geladen", {"OK"} )
ENDIF
IF ! DbeBuild( "FOXCDX", "FOXDBE", "CDXDBE" )
Alert( "FOXCDX Database-Engine;" + ;
"konnte nicht erzeugt werden" , {"OK"} )
ENDIF
DbeSetDefault( "FOXCDX" )
RETURN
RETURN
Hat jemand hierzu eine Idee ?