CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Back after long long time!

    After some problems I faced, I believe that I am back in development progress... Nice to meet you all of you again.

    So, I will start with my first post asking sth:
    How can a VB app running as desktop application to get info (to be related) with an asp running on IE of the same machine.

    For example, the user enters a text inside a text box in the asp (using IE) and the asp sends this info to the server and store it to the DB. How can this text be related with the desktop vb application that runs on the same client machine. For example to take this text and show it as label caption.
    Do I have to connect to the db remotely? And how can it be done? or using internet technologies is better solution?

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Back after long long time!

    Welcome back, Michael.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Back after long long time!

    Nice to meet you friend and all others here! Am I still in top ten ? :-)

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

  4. #4
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Back after long long time!

    welcome back.

    as for you question. if the user is entering information on a webiste, then you want to use that info as the caption of a button in a vb form - then the website must place that info in a place that's accessible to the vb app. if it's in a database, then the vb app must be able to connect to it. or, you might be able to do some client side script to store that info in a file on the client machine, but the user will be asked abou ActiveX scripting/controls and security stuff. the databse would be the better choice, but it MUST be available to the vb clients.

    good luck,

    john

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  5. #5
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Back after long long time!

    Using ODBC and DSN I can easily connect to DB located to LAN. But how can I connect to a DB through Internet? And how easy is it? Any help?

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

  6. #6
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Back after long long time!

    I've been trying to do that for a little while now. One thing that seems to always be an issue is, if the server is behind a firewall (MS Proxy Server etc). I did run across this article on M$ about this:http://support.microsoft.com/support.../Q269/8/82.ASP. It says you can use the IP address of the server and it will connect on port 1433, by default, to the server. I have not been able to do with, even without a firewall running.

    if you make any progress, i'd be very interested in finding out how you did it.

    good luck,

    john

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  7. #7
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Back after long long time!

    i got it! For me, anyway, the trick was supplying the port number in the IP address of the server. For some reason, i was alway using a colon instead of a comma. Once i changed it, everything worked as expected. here's my code to connect:

    Dim cn as ADODB.Connection
    Dim rs as ADODB.Recordset
    Dim sql as string
    Dim sConnect as string

    sConnect = "Provider=SQLOLEDB;Persist Security Info=true;Initial Catalog=MyDB;Server=000.000.000.000,1433;"
    sConnect = sConnect & "Network Library=dbmssocn;User ID=;Password=;"

    set cn = new ADODB.Connection

    cn.Open sConnect

    sql = "SELECT * FROM Links (nolock)"

    set rs = new ADODB.Recordset
    set rs = cn.Execute(sql)

    While Not rs.EOF
    Debug.print rs(1).Value
    rs.MoveNext
    Wend

    rs.Close
    set rs = nothing

    cn.Close
    set cn = nothing




    hope this helps,

    john

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  8. #8
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Back after long long time!

    Welcome back. We can use some fresh energetic talent.

    John G

  9. #9
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Back after long long time!

    I used your code to connect to the server but I failed. Two questions: Is Initial Catalog the name of the database?
    And what is Network Library?

    I try to connect from a PC that is inside Proxy. The Server that I try to connect to, is not inside proxy.

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

  10. #10
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Connect to SQL Server via Internet

    >>Is Initial Catalog the name of the database?
    Yes - same as the "Database=" parameter. The examples i saw used this, so i didn't mess with it.

    >>And what is Network Library?
    Just a flag that forces ADO to use the TCP/IP network library, instead of something else.

    >>I try to connect from a PC that is inside Proxy. The Server that I try to connect to, is not inside proxy.

    I tested this from home, no proxy anywhere, and it worked okay. Then i tested this at work, proxy at client, not at database, and it worked. One you have to know - is the SQL Server port blocked by your proxy? By default, it's 1433. You can check with your network admin to find out. As long as that port is open, it should work. It's fairly slow, so you may have to increase the connection timeout parameter, but it should work.

    What is the error you're getting?

    John

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  11. #11
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Connect to SQL Server via Internet

    "SQL Server doesn't exist or access denied."

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

  12. #12
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Connect to SQL Server via Internet

    I was getting that error for a while too, then i realized that i had the IP/Port addresses wrong (i was using a : instead of a comma to specify the Port number after the IP). If you are 100% certain that they are correct, then chances are, that port is blocked in the firewall (proxy) - which is why ADO can't find the server. Give your network admin a call and see if you can have him/her open up that port for a few minutes. {shrug}

    good luck,

    john

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  13. #13
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Back after long long time!

    ok I have problem with the db. tell me if I create client script to save info from asp to the client PC, then how will be related every record with my vb app? For example, for every icon the user created in my vb app, I want this every icon to be related with one specific record of those that the asp should send to the server.
    More specific: let's suppose the user has inserted today 5 records to the db with 5 fields each. And he has also created 3 icons in the vb app. How will I relate those 3 icons with 3 of those 5 records? One more field maybe as ID? but how can be related? Any idea?

    Michael Vlastos
    Automation Engineer
    Intracom, Research & Development Division
    Development Programmes Department
    Athens, Greece

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured