Connecting modem thru code

M

Mota

Hi;
Is there an API to query modem and if there is a free dial tone returns
something,and if the connected line is in-use,returns something
else(Checking the line connected to modem,no dialing needed).
Thank you in advance for ur help.
 
A

Adrian Jansen

You asked this exact question on 9th Feb. And I replied with some
suggestions on the 10th. Did this not help ?

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
M

Mota

Thank you for that.
But,unfortunately my news reader (Outlook Express)shows my post with no
reply.Im wondering why sometime this happenes.
Anyway,Can you plz send it again?will be so grateful to you.
 
A

Adrian Jansen

This was my original reply:

-----------
You need to pass a command string to the modem, to get it to reply. And you
can set various types of response, at least with Hayes type modems. Look up
the manual for the modem first, to see what you need to send. Or Google for
'Hayes commands'

Sending the string is easy. Open a port to Com1 ( or wherever the modem is
connected ). Print strings to the port. Get responses back with Line
Input.

eg
dim strResponse as string

Open "Com1,9600,n,8,1" for random as #1 'random allows both input and
output.

Print #1,"ATI" 'ATI is a standard Hayes command to return modem information

Line Input#1,strResponse

debug.print strResponse 'just to see what the modem returned.

Close #1 'always close a port you opened

Just from memory "ATO" should put the modem online, and you get a response
to tell you whether the command succeeded, eg "No Dialtone" "Connect xxxx"
etc, depending on how you set up the responses.

--------------

Interesting you could not see it. I checked on the Google archive, and my
response was there, in fact I copied it from the archive to the text above.

The archive for this newsgroup is at:
http://groups.google.com/groups?hl=en&lr=&q=&btnG=Google+Search&meta=group%3
Dmicrosoft.public.access.formscoding

All on one line, of course.
--

Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
M

Mota

Thank you.
I tried it,but run time error 54 occures "Bad File Mode" and the problem is
in the 2nd line:
Print #1,"ATI"
Any solution?
thank you so much.
 
A

Adrian Jansen

Answered in thread "Connecting to modem"

It would be simpler if you did not start a new thread for essentially the
same question.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top