Solved

I tried to execute the sms program from VB it gives an error saying invalid port number

Posted on 2004-10-03
9
213 Views
Last Modified: 2006-11-17
' Set up the communications port
MSComm1.CommPort = 1 ' Com Port 1

' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"

' Tell the control to read entire buffer when Input is used
MSComm1.InputLen = 0

' Open the port
MSComm1.PortOpen = True

' Send an 'AT' command to the phone
MSComm1.Output = "AT" & Chr$(13) & Chr(10)
' The phone will respond with an 'OK'

' Set up the phone for a text message
MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
' The phone will respond with an 'OK'

' Prep for SMS, give destination type and destination address.
' Enter the destination type and destination address to prep for SMS
' e.g. AT+CMGS="+2145551212",129
MSComm1.Output = "AT+CMGS= " & Chr(34) & _
    "+2145551212"" & Chr(34) & ",129" & Chr$(13) & Chr(10)
' The phone will return a'>' prompt, and await entry of the SMS message text.

' Now send the text to the phone and terminate with (Ctrl-Z)
MSComm1.Output = "This is a test. WOW! "
' The phone will respond with a conformation containing
' the 'message reference number' eg. +CMGS:

' Close the port
MSComm1.PortOpen = False


i tried to execute this program in  Nokia 6230 mobile which is connected to my computer. It gave an error Invalid Port number. whats the reason ? i tested with my nokia software , its running properly. only in VB its giving an error. I have connected the USB to first USBport. i have 4 USB port in my laptop, i am using WinXp Prof.
0
Comment
Question by:raj_ms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213431
You have provided an example for RS232 SERIAL COMMUNICATION, so unless your USB cable is a USB-2-Serial-Converter, then it is not possible.
0
 

Author Comment

by:raj_ms
ID: 12213436
how to make it work do you have any idea. i have only USB cable. is there any way to send mesage to mobile using usb cable?
0
 

Author Comment

by:raj_ms
ID: 12213440
how do i communicate to my mobile using usb cable
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213473
Nokia 6230 has a software called 'PC Suite', this software include modem drivers, according to manuals, if you have installed drivers, you can use the phone as a standard SERIAL modem, but first have to look in Control Panel for serial number.

PS. USB numbering is not related to serial numbering.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213476
0
 

Author Comment

by:raj_ms
ID: 12213489
i have already installed this software. how do i find the serial number.i dont want to use that software. i want to write the code in vb, may be i can use the usb driver library file,but tell me how to use that as well.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 12213522
If you have correctly installed the software, then a serial port will be emulated, I guess. Launch 'Control Panel', pick 'Modems' Icon, and see the 'COMx' number in its properties.
0
 

Author Comment

by:raj_ms
ID: 12272257
I am sorry for the delay, but i cant find the port no. in control panel i haave clicked the system icon's property. in hardware tab, device manager i clicked the ports, it doesnt show the nokia phone port, where can i find the port no of my nokia phone 6230 to send and recieve message.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Determine Range to Select 5 64
Passing a Text Box name to a Sub 6 104
Outlook Macro to delete emails not meeting keywords 56 113
can this macro be converted to sub procedure 4 33
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question