Input and InputB Functions (Differences in String Function Operations)

The memory storage formats for text differ between Visual Basic for Applications (VBA) code and Access Basic code. (Access Basic was used in early versions of Microsoft Access.) Text is stored in ANSI format within Access Basic code and in Unicode format in Visual Basic. This topic discusses one potential issue when handling strings in the current version of Microsoft Access. For more information, see Differences in String Function Operations.

The Input function in Microsoft Access converts the number of characters designated when the text is read from the file into a Unicode string and reads them as variables. The InputB function, on the other hand, assumes the data to be binary data and stores it as variables without converting it. If the InputB function is used when reading a file stored in a fixed length field, the fixed byte length data must be converted once it is read.

Open "Data.Dat" For Input As 1 
dat1 = StrConv(InputB(10, 1), vbUnicode) 
dat2 = StrConv(InputB(10, 1), vbUnicode) 
dat3 = StrConv(InputB(10, 1), vbUnicode) 
 
===DATA.DAT 
123456789012345678901234567 
Name Address Telephone