MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Visual Basic 6.0

This is a discussion on Visual Basic 6.0 within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; As you may see the above code I am very amateur but very enthusiastic to learn and develop my programming ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-15-2004
Junior Member
White Belt
 
Join Date: Apr 2004
Posts: 1
Visual Basic 6.0

As you may see the above code I am very amateur but very enthusiastic to learn and develop my programming skills.
1- My question to you is how I can display the fields from the database using this code. I am trying to make this application to allow a user to pass three variables and run the query embedded in the code to bring the result form the database.
2-Is there anyway to make a connection other than the one I used in my code.
3-Is it possible to connect this code with crystal report

N.B I used fake user id and password to protect my database hope u understand that.

I really appreciate your time and priceless help.





Private Sub cmdCommand_Click()

Dim LettingNO As String
Dim ContractId As String
Dim CallNo As String
Dim adoConnection As ADODB.Connection
Dim adoRecordSet As ADODB.Recordset
Dim ConnectString As String
Dim mySQL As String

'create a new connection--
Set adoConnection = New ADODB.Connection

'create a new recordset object used to reference values from sql statement....
Set adoRecordSet = New ADODB.Recordset

'Purpose: Creates the connection string for Oracle
ConnectString = "Provider=OraOLEDB.Oracle;Persist Security Info=true;" & _
"Data Source=" & "datasource" & _
";User ID=" & "fakeid" & _
";Password=" & "fakeid"


'create SQL statement so the recordset object will reference to that...
mySQL = "SELECT DISTINCT Q.IPLINENO,I.ITEM,I.IDESCR,Q.QTY,I.IUNITS,"
mySQL = mySQL & "Q.PRICE,AVG(C.BIDPRICE),MIN(C.BIDPRICE)"
mySQL = mySQL & "FROM LETPROP L, PROJECT R, PROPPROJ J, PROPOSAL P, PROPITEM Q,"
mySQL = mySQL & "BIDLET B, BIDTABS C, ITEMLIST I,VENDOR V, BIDDERS D"
mySQL = mySQL & "WHERE L.Letting = B.Letting AND B.LETTING = C.LETTING,"
mySQL = mySQL & "AND P.CSPECYR = I.ISPECYR AND Q.PRPITEM = I.ITEM,"
mySQL = mySQL & "AND P.CONTID = L.LCONTID AND Q.CONTID = P.CONTID,"
mySQL = mySQL & "AND C.VENDOR = L.AVENDOR AND L.CALL = C.CALL,"
mySQL = mySQL & "AND Q.LINEFLAG = C.LINEFLAG AND Q.IPLINENO = C.IPLINENO,"
mySQL = mySQL & "AND R.PCN = J.PCN AND L.LETTING = D.LETTING,"
mySQL = mySQL & "AND C.LETTING = L.LETTING AND C.CALL = D.CALL,"
mySQL = mySQL & "AND C.LETTING = D.LETTING AND V.VENDOR = D.VENDOR,"
mySQL = mySQL & "AND L.LETSTAT = 'A'AND C.LINEFLAG = 'L',"
mySQL = mySQL & "AND L.LETTING =" & LettingNO
mySQL = mySQL & "AND P.CONTID =" & ContractId
mySQL = mySQL & "AND L.CALL =" & CallNo
mySQL = mySQL & "GROUP BY Q.IPLINENO,I.ITEM,I.IDESCR,Q.QTY,I.IUNITS,Q.PRICE, C.BIDPRICE"
mySQL = mySQL & "ORDER BY Q.IPLINENO"


'This will open the connecion String
adoConnection.Open ConnectString

'Before this adoRecordSet object make the refernce to the mySQL statement
'it will open the connecion using the connecion string object "adoConnecion"

adoRecordSet.Open mySQL, adoConnection

' 'List1.AddItem adoRecordSet!addend
' Set adoRecordSet = adoConnection.Execute("select distinct contid from addend where rownum < 10")
' Set adoRecordSet = adoConnection.Execute("mySQL")
' List1.AddItem adoRecordSet!contid
' List1.AddItem adoRecordSet!contid

End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
basic, visual


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Visual Basic 6.0 Anonymous MapPoint 2006/2009 Discussion 1 08-06-2004 07:17 AM
mappoint, visual c++ vs visual basic Anonymous MapPoint 2006/2009 Discussion 6 03-30-2004 10:17 PM
Visual Basic with Map Point Anonymous MapPoint 2006/2009 Discussion 1 10-10-2003 09:58 PM
Visual Basic. NET and MapPoint Anonymous MapPoint 2006/2009 Discussion 1 07-30-2003 03:49 PM
Visual basic or visual c++ in mappoint misterb83 MapPoint 2006/2009 Discussion 1 02-14-2003 09:31 AM


All times are GMT -5. The time now is 04:19 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54