Solved

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

Posted on 2004-10-03
9
204 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 28
Access query that references subform 5 43
MS Date Picker 64 bit 32 bit issue 12 49
fso.FolderExists("\\server\HiddenFolder$") 4 52
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now