![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi to all. I'm new to this ng. And i'm almost new to btrieve programming. The question. I'm trying to get data from a Btrieve database(6.15) from within a VB.net module. I use: DECLARE FUNCTION BTRCALL LIB "Wbtrv32.dll" (Byval oc as ushort, byval pb as string, <Marshalasattribute(unmanagedtype.asany)> byval Db as object, byval Dl as integer, byval Kb as string, Marshalasattribute(unmanagedtype.asany)> byval Kl as object, byVal Kn as char) as integer when I call the function as follow: status = BTRCALL(B_Open, Pblock, DataBuf, BufLen, KeyBuf, KeyBufLen, "0") where: B_Open is a costant = 0 PBlock is a space(128) DataBuf as RecordBuffer buflen as integer keybuf = Filename (C:\Ex\Data.btr") keybuflen = space(255) What I get when it starts is an error referring to keybuflen which "attempts to read or write a protected memory area". Where is the problem? thanks in advance |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Have changed to Int64 both the declaration and the variable and still have the same error. (Begging your pardon for my incopetence I'm relatively new in programming vb.net, by now I have written in VBA) thanks again for your help DECLARE FUNCTION BTRCALL LIB "Wbtrv32.dll" (Byval oc as ushort, byval pb as string, <Marshalasattribute(unmanagedtype.asany)> byval Db as object, byval Dl as integer, byval Kb as string, Marshalasattribute(unmanagedtype.I8)> byval Kl as Int64, byVal Kn as char) as integer P.S. I'm trying to follow istructions written in a btrieve manual Pervasive have posted on their site. |
#5
| |||
| |||
|
|
"Enzo" <mmm (AT) mmm (DOT) it> wrote in message news:4415ae47$0$29111$5fc30a8 (AT) news (DOT) tiscali.it... Have changed to Int64 both the declaration and the variable and still have the same error. (Begging your pardon for my incopetence I'm relatively new in programming vb.net, by now I have written in VBA) thanks again for your help DECLARE FUNCTION BTRCALL LIB "Wbtrv32.dll" (Byval oc as ushort, byval pb as string, <Marshalasattribute(unmanagedtype.asany)> byval Db as object, byval Dl as integer, byval Kb as string, Marshalasattribute(unmanagedtype.I8)> byval Kl as Int64, byVal Kn as char) as integer P.S. I'm trying to follow istructions written in a btrieve manual Pervasive have posted on their site. Without checking, I believe the key buffer length parameter should be a short integer, but possibly a long integer. Definitely not a 64-bit integer, though. |
![]() |
| Thread Tools | |
| Display Modes | |
| |