Inconsistency?

Karl Grob kgrob at mus.ch
Tue Nov 18 08:48:17 CST 2014


Hi

I do not understand why the first one works and the second one doesn’t.
The error resides in p (if I try INSERT only with fldCharPict and p it throws the same error).

Karl

——————————————————————————


tblFonts.setOneRecordClassWay

Private Shared Function setOneRecord(char as string, Fontname as string, Fontsize as double, Fontstyle as cl_S tyle.Styles, charPict as picture, baseline as double, italicWidth as double) As Integer

dim s, p as string
p = PicturetoBinaryStringMBS(charPict)

myDB.Table(name).SetBlank
myDB.Table(name).StringField(fldChar).Value = char 
myDB.Table(name).VarBinaryField(fldCharPict).SetString(p) 
myDB.Table(name).VarCharField(fldFontName).Value = Fontname 
myDB.Table(name).FloatField(fldFontBaseline).Value = baseline 
myDB.Table(name).FloatField(fldFontSize).Value = Fontsize*1.4 
myDB.Table(name).ByteField(fldFontStyle).Value = Int32(Fontstyle) 
myDB.Table(name).FloatField(fldItalicWidth).Value = italicWidth
s = Fontname + "_" + myDB.Table(name).ByteField(fldFontStyle).GetString + "_" + myDB.Table(name).FloatFi eld(fldFontSize).GetString + "_" + Format(asc(char), "000000") mydb.Table(name).VarCharField(fldUniqueKey).Value = s
Win_Zaehler.res = myDB.Table(name).AddRecord

End Function

This one works

——————————————————————————

tblFonts.setOneRecord

Private Shared Function setOneRecord(char as string, Fontname as string, Fontsize as double, Fontstyle as cl_Style.Style s, charPict as picture, baseline as double, italicWidth as double) As Integer

dim res as Integer dim s, p as string

p = PicturetoBinaryStringMBS(charPict)

s = "INSERT INTO " + NAME + "(„ 
s = s + fldChar + ", "
s = s + fldCharPict + ", "
s = s + fldFontName + ", "
s = s + fldFontSize + ", "
s = s + fldFontStyle + ", "
s = s + fldFontBaseline + ", "
s = s + fldItalicWidth + 
s = s + ") VALUES( "
s = s + "'" + char + "', "
s = s + "'" + p + "', „ //error 462848. no string value
s = s + "'" + Fontname + "', "
s = s + "" + str(Fontsize) + ", "
s = s + "" + str(Integer(Fontstyle)) + ", „ 
s = s + "" + str(baseline) + ", "
s = s + "" + str(italicWidth) + ")"

res = myDB.SqlExecute(s) 
myDB.Flush
return res

myDB.Table(name).SetBlank 
End Function

This one does not work, ErrorNumber 462848



More information about the Valentina mailing list