
07/10/2008, 09:29
|
| | Fecha de Ingreso: octubre-2008 Ubicación: La Paz
Mensajes: 1
Antigüedad: 16 años, 5 meses Puntos: 0 | |
Caller ID desde la web Basandome en un documento para acceder al Caller ID desde la web usando Visul Basic, estoy queriendo implementar esta solucion. Tengo problemas cuando trato de conectar el VB con SQL, pero no se exactamente que suede.
Esto es lo que se tiene en VB :
Public Call_Name As String
Public Call_Number As String
Private Sub Form_Load()
With MSComm1
.Settings = "9600, N, 8, 1" '// Baud, Parity, Data Bits, Stop Bits
.CommPort = 2 '// Change to the port of your modem
If .PortOpen = False Then '// If the port is not already open
.PortOpen = True '// open it
End if
.RThreshold = 0
.InputLen = 0
.Output = "AT#CID=1" & Chr(13) '// Send the modem the
'// appropriate AT command
'// to enable the modem to
'// sit and wait for
'// incoming calls and capture
'// the caller id information
'// Check the modem's documentation
'// for the correct string
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False '// Close the port when the
'// program is closed
End Sub
Private Sub MSComm1_OnComm()
Dim Buffer As String '// Will hold the string
'// from the modem
'// I was having problems dealing with
'// the returns and line feeds so I deleted
'// them from the Buffer
Buffer = Replace(MSComm1.Input, Chr(13), "")
Buffer = Replace(Buffer, Chr(10), "")
GetCallerInfo (Buffer)
End Sub
Private Sub GetCallerInfo(Caller_Id_string As String)
If InStr(Caller_Id_string, "NAME") > 0 Then
Call_Name = Mid(Caller_Id_string, (InStr(Caller_Id_string, "NAME = ") + 7), _
((InStr(Caller_Id_string, "NMBR = ") - 7) - InStr(Caller_Id_string, "NAME = ")))
End If
If InStr(Caller_Id_string, "NMBR") > 0 Then
Call_Number = Mid(Caller_Id_string, (InStr(Caller_Id_string, "NMBR = ") + 7))
End If
If Len(Call_Name) > 1 Or Len(Call_Number) > 1 Then
Call Database_Update()
End If
End Sub
Private Function Database_Update()
Dim Command_Text As String
Command_Text = "Insert Into tbl_Caller_Id (Call_Name, Call_Number)" & _
"Values ('" & Call_Name & "', '" & Call_Number & "')"
Dim myConnection As New ADODB.Connection
myConnection.Open "Driver={SQL Server};" & _
"Server=localhost;" & _
"Database=mydb;" & _
"Uid=;" & _
"Pwd=;"
myConnection.Execute (Command_Text)
myConnection.Close
Call_Name = "" '// Set the values back to nothing
Call_Number = ""
End Function
Tengo un error de compilacion en :
Dim myConnection As New ADODB.Connection
Mi mayor problema es que no se nada sobre SQL, aunque estuve tratando de enterder mas al respecto. No se como debe ser la estructura que se debe armar en SQL, con que tablas y que campos ??
Por favor, pido su ayuda.
Muchas gracias y hasta pronto |