Discussion Locked

visual basic challenge

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi, i am developing a application in which i want to give a area in which user can draw a image and sava it to database with its id.

please solve my prblem as soon as possilble.

3 replies

by dryflies

use the doodle example that comes with VB and study up on ADODB. here is a hint:
Public Function getDoctorPhone(Doctor As String) As String

Dim dbll As ADODB.Connection
Dim docs As ADODB.Recordset
Dim Phone As String
Dim cnn1 As String
Dim grystr As String

Dim dbsource As String
If Doctor = "" Then
getDoctorPhone = ""
Exit Function
End If

dbsource = CurrentDb.Name
cnn1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbsource + ";"
Set dbll = New ADODB.Connection
dbll.Open cnn1
qrystr = "SELECT [Doctor List].DoctorPhone FROM [Doctor List]WHERE ((([Doctor List].DoctorName)=""" + Doctor + """));"
Set docs = New ADODB.Recordset
docs.Open qrystr, dbll
docs.MoveFirst
If docs.EOF = False Then
getDoctorPhone = docs.Fields("DoctorPhone")
Else
getDoctorPhone = "(555)555-1212"
End If
docs.Close
dbll.Close
End Function

This discussion is closed to new replies.