Connecting modem thru code

  • Thread starter Thread starter Mota
  • Start date Start date
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.
 
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
 
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.
 
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
 
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.
 
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
 
Back
Top