วิธีการอ่านข้อความของ ADO
❮ การอ้างอิงออบเจกต์สตรีมที่สมบูรณ์
เมธอด ReadText ใช้เพื่ออ่านสตรีมทั้งหมด บรรทัด หรือจำนวนอักขระที่ระบุจากออบเจกต์สตรีมข้อความ และส่งกลับข้อมูลผลลัพธ์เป็นสตริง
หมายเหตุ:วิธีนี้ใช้เฉพาะกับออบเจ็กต์สตรีมข้อความ สำหรับออบเจ็กต์สตรีมแบบไบนารี ให้ใช้เมธอด Read
ไวยากรณ์
str=objStream.ReadText numchars
Parameter | Description |
---|---|
numchars | Optional. The number of characters to read from the file,
or a StreamReadEnum value. Default is adReadAll
If you have specified more than the number of characters left in the Stream, only the character remaining are returned |
ค่า StreamReadEnum
Constant | Value | Description |
---|---|---|
adReadAll | -1 | Default. Reads all characters from the stream, from the current position to EOS |
adReadLine | -2 | Reads the next line from the stream |
❮ การอ้างอิงออบเจกต์สตรีมที่สมบูรณ์