Solved

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

Posted on 2004-10-03
9
209 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA color chart bars 12 86
Hide vba in gp 7 95
TT Auto Dashboard 13 92
Advice in Xamarin 21 80
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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