Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UDL files and FILETOSTR()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Divers
Thread ID:
01333299
Message ID:
01333321
Vues:
11
Hi Evan,

Yes, it's stored in Unicode. You can use StrConv to do required conversions
* Read UDL, strip 2 byte unicode BOM (Byte-order mark) and convert to ASCI
lcUdlStr = STRCONV(SUBSTR(FILETOSTR("Test.udl"),3), 6)
* Make changes
...
* Convert back to Unicode, write UDL back to a file adding Unicode BOM
= STRTOFILE(STRCONV(lcUdlStr,5), "Test1.udl", 2)
>
>I'm attempting to create an interface which allows a user to select from a list of available back-end database connections. I have a group of UDL files which contain the connection information (this encompasses some non-SQL Server backends as well), and I'm attempting to read these files with the FILETOSTR() function and parse some of the information in order to build the list.
>
>HERE'S THE PROBLEM: When each file comes in using FILETOSTR(), it's high-order-bit garbage (either Unicode or some other unreadable stuff). Each file opens in Notepad without a hitch, and shows the text as expected.
>
>There's no additional parameters on the FILETOSTR function, and I can't seem to locate a way to successfully convert this junk out of Unicode (or whatever it is) and back to ANSI.
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform