DBCreate

This forum is meant for questions and discussions about the X# language and tools
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

DBCreate

Post by Horst »

Hallo
i try to create a DB . On the memofield it stops. What do i wrong? This work on VO

aStruct := { ;
{ "IS_FAKTURA","L",1,0 } ,; // LIEFERSCHEIN IST IN EINER RECHNUNG AUFGEFÜHRT
{ "FARBE","C",20,0 } ,;
{ "Id_Liefer" , "C" , 15 ,0 } ,; // LIEFERSCHEIN ID
{ "GEWICHT","C",20,0 } ,;
{ "ID_ARTIKEL","C",10,0 } ,;
{ "BESTELL_NR","C",20,0 } ,;
{ "ARTIKEL1","C",60,0 } ,;
{ "ARTIKEL2","C",30,0 } ,;
{ "ARTIKEL3","C",30,0 } ,;
{ "PRB","N",15,2 } ,;
{ "EINHEIT","C",20,0 } ,;
{ "MWSTSATZ","N",5,2 } ,;
{ "MENGE","N",9,3 } ,;
{ "RAHMENNR","C",40,0 } ,;
{ "MEINTEXT","M",0,0 } ,;
{ "FFONT","C",3,0 } ,;
{ "BLOCKTOTAL","C",30,0 } ,;
{ "DIMENSION","C",30,0 } ;
}

// DBCREATE(cTempFile,aStruct,"DBFCDX",,,,)
DO WHILE TRUE
IF DbCreate(cTempFile,aStruct,"DBFCDX",,,,)

Beschreibung : Field 'MEINTEXT' is not valid
Subsystem : DBFCDX
Generischer Code : EG_ARG Argumentfehler
Untercode : 1113 Datenbank-Header korrupt
FuncSym : ValidateDbfStructure
Schwere : ES_ERROR
Kann Default : False
Kann erneut versuchen : False
Kann ersetzen : False
Aufrufreihenfolge :
bei XSharp.RDD.DBF._checkFields(RddFieldInfo info)
bei XSharp.RDD.Workarea.AddField(RddFieldInfo info)
bei XSharp.RDD.DBF.AddField(RddFieldInfo info)
bei XSharp.RDD.Workarea.CreateFields(RddFieldInfo[] aFields)
bei XSharp.CoreDb.<>c__DisplayClass35_0.<Create>b__0()
bei XSharp.CoreDb.Do[T](Func`1 action)
bei XSharp.CoreDb.Create(String cName, RddFieldInfo[] aStruct, Type rddType, Boolean lNew, String cAlias, String cDelim, Boolean lKeep, Boolean lJustOpen)
bei XSharp.CoreDb.<>c__DisplayClass33_0.<Create>b__0()
bei XSharp.CoreDb.Do[T](Func`1 action)
bei XSharp.CoreDb.Create(String cName, RddFieldInfo[] aStruct, String cRddName, Boolean lNew, String cAlias, String cDelim, Boolean lKeep, Boolean lJustOpen)
bei XSharp.RT.Functions.DbCreate(__Usual[] Xs$Args)
bei _Swissbase-Functionen.Functions.CreateAufTemp(String cIDC_PathTmp, String gcUserId) in C:XIDEProjectsSwissbaseApplications_Swissbase-FunctionenShared Auftrag.prg:Zeile 135.

Horst
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

DBCreate

Post by wriedmann »

Hi Horst,
for the fieldtype "M" you cannot indicate a field width of 0.
VO ignores this, but X# requires the correct indication of 10.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DBCreate

Post by Chris »

Hi Horst,

That's because of the MEMO field, you have specified a length of 0, while this should be 10. But I see that indeed VO works also with zero, apparently it ignores the length you specify and always uses the correct one. WIll log this a a compatibility problem, thanks!

Edit: Well, what Wolfgang said already! :)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

DBCreate

Post by Horst »

Hallo
Thanks, so i will put 10.

btw why put a length ? its a memofield ;-)

Horst
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

DBCreate

Post by robert »

Horst,
Horst wrote:Hallo
Thanks, so i will put 10.

btw why put a length ? its a memofield ;-)

Horst
We now also support the new FoxPro Memo field which has a width of 4 (it stores the block address as an integer and not as ascii).
So we need to know which type you want.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

DBCreate

Post by Horst »

Hi Robert

Mmm you can see it on the dialect switch i am using ?
btw its written XSharp.RT (in XSharp.RT.dll) Version: 2.6 , so dbcreate () doesnt need a vo dll ??
Horst
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

DBCreate

Post by robert »

Horst,
I'll change the RDD system to look at the type of RDD and adjust the column width automatically.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DBCreate

Post by Chris »

Hi Horst,

The XSharp.VO library is very small, only contains a few functions (like Crypt()) and types (like VObject and OleAutoObject) which are specific to VO dialect apps. All the main runtime functionality is implemented in XSharp.Core and XShar.RT, so some VO dialect apps (that do not use the VOSDK) do not even need XSharp.VO at all.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Horst
Posts: 336
Joined: Tue Oct 13, 2015 3:27 pm

DBCreate

Post by Horst »

i have a question.
Xsharp shoud be the new xbase language for .net
so the goal shoud be , that all people is slowly switched to the core dialect. and all other like Vo, Foxpro and Harbor shoud be supported for old programs.
my question, is it possible to rewrite my app without any compromise ? so i can use the core dialect and a dbf database. and i dont like also this x86 radiobutton (sounds so old, like i make apps on a win95 computer ;-) )
i hope folks you understand what i am asking about.
what i need as a beginner in X#, is a app like ssatutor in pure X#.
Horst
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

DBCreate

Post by wriedmann »

Hi Horst,
let me try to answer: with VO, the life was relatively simple as there were only the VO GUI classes as GUI choice, and DBF databases were the best option.
With pure X#, you have the choice between Windows Forms and WPF, and you have the choice if using MVVM or not (for WPF it seems the best option, whereas in the older Windows Forms world it does not seem to be so used).
What should such a sample application use? And what type of database? These days I would see DBF only as niche database, and any sort of SQL databases as mainstream.
I agree that such a sample application could help a lot, and I thought many times I should provide one, but was always missing the time.
But maybe now that we again have a "hard" lockdown (here in South Tyrol we cannot exit anymore freely as our hospital capacities are exhausted) maybe I will have some time for such a project.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply