By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,297 Members | 705 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,297 IT Pros & Developers. It's quick & easy.

How can I send a string using MS Access 2003 to an RS232 port?

P: 3
Hi, I'm trying to send a small string to a serial port rs232 located in com 4.

the string is: "ST GA#"
The Baud Rate is: 38400
Parity: None
Data Bits: 8
Stops Bits: 1
Flow Control: None
COM: 4

I don't really need to read the com, I just need to send this line to the selected com.
I have not idea to create this code in MS Access 2003.
can anyone help me on this?

THX.
Oct 1 '07 #1
Share this Question
Share on Google+
5 Replies

FishVal
Expert 2.5K+
P: 2,653
Hi, I'm trying to send a small string to a serial port rs232 located in com 4.

the string is: "ST GA#"
The Baud Rate is: 38400
Parity: None
Data Bits: 8
Stops Bits: 1
Flow Control: None
COM: 4

I don't really need to read the com, I just need to send this line to the selected com.
I have not idea to create this code in MS Access 2003.
can anyone help me on this?

THX.
Hi, Canuno.
Did you try to open COM4 as file. Like this:
Expand|Select|Wrap|Line Numbers
  1. Open "COM4" For Binary Access Write As #1
  2. Print #1, "ST GA#"
  3. Close #1
  4.  
Oct 1 '07 #2

P: 3
Hi, Canuno.
Did you try to open COM4 as file. Like this:
Expand|Select|Wrap|Line Numbers
  1. Open "COM4" For Binary Access Write As #1
  2. Print #1, "ST GA#"
  3. Close #1
  4.  

Yes I did, and I got an Run time error 54, Bad File Mode.
Oct 2 '07 #3

FishVal
Expert 2.5K+
P: 2,653
Yes I did, and I got an Run time error 54, Bad File Mode.
Try another open mode.
Expand|Select|Wrap|Line Numbers
  1. Open "COM4" For Output As #1
  2. Print #1, "ST GA#"
  3. Close #1
  4.  
Oct 2 '07 #4

P: 3
Excelent!!! It works now. great job, I really apreciate it.
canuno@hotmail.com
Oct 2 '07 #5

FishVal
Expert 2.5K+
P: 2,653
You are welcome.

Best regards.
Fish.


P.S. plz avoid posting your e-mail unless you are calling for spammers.
Oct 2 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.