Click to See Complete Forum and Search --> : Back after long long time!


Dr_Michael
April 11th, 2001, 03:51 AM
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

Iouri
April 11th, 2001, 06:58 AM
Welcome back, Michael.

Iouri Boutchkine
iouri@hotsheet.com

Dr_Michael
April 11th, 2001, 07:01 AM
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

Johnny101
April 11th, 2001, 10:28 AM
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

Dr_Michael
April 12th, 2001, 02:48 AM
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

Johnny101
April 12th, 2001, 12:38 PM
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/kb/articles/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

Johnny101
April 13th, 2001, 10:50 AM
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 G Duffy
April 14th, 2001, 08:47 AM
Welcome back. We can use some fresh energetic talent.

John G

Dr_Michael
April 18th, 2001, 02:38 AM
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

Johnny101
April 18th, 2001, 09:02 AM
>>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

Dr_Michael
April 18th, 2001, 09:06 AM
"SQL Server doesn't exist or access denied."

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

Johnny101
April 18th, 2001, 09:15 AM
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

Dr_Michael
May 24th, 2001, 07:14 AM
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