Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values from VB6 To Website Database 1

Status
Not open for further replies.

HomeAway

Programmer
Jun 6, 2003
36
0
0
AE
Hi Experts,
Ive been asked to start a project and need some general guidance.
Q.) What i need to do:
- Create a stand alone VB app that allows a user to
input some data.
- I then need to pass that data from the vb app to an SQL
database on my remote webserver.

Im kinda stuck as to how to approach this. I would prefer to create a website to do this but for initial concept proof they have asked for a vb app. My webserver does allow for "public" DSN access [secured of course]. But i was wondering if i could use XML? Are you able to generate an XML message, point it at a url which will then insert the record into the database?

Thanks in advance.
 

Yes, I belive you should be able to do the XML portion and even a post with the XML object either 3.0 or 4.0. You will need to look further into the help file for more information on the XML object (Project>References).

Good Luck

 
But i was wondering if i could use XML? Are you able to generate an XML message, point it at a url which will then insert the record into the database?

I must be missing something, but why go to the trouble? Connect to the database in your VB program and manipulate as needed. Do it all with ADO.
 
HomeAway,

You can do this by specifying the IP address to the remote server.

Here's an example in connection to a remote server (via IP address):

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
Where:
- "Network Library=DBMSSOCN" tells SqlConnection to use TCP/IP
- xxx.xxx.xxx.xxx is an IP address.
- 1433 is the default port number for SQL Server.
- You can also add "Encrypt=yes" for encryption

Hope this helps......

chris

 
HomeAway,

Or this.......

oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

Where:
- "Network Library=DBMSSOCN" tells OLE DB to use TCP/IP rather than Named Pipes
- xxx.xxx.xxx.xxx is an IP address
- 1433 is the default port number for SQL Server.
- You can also add "Encrypt=yes" for encryption

chris
 
Cheers Experts,
Some excellent ideas. Chris, thankyou for your post, ive learnt something new today.

I would like to go the XML route, as it would be first for me and something new to try. Is my logic for the following
correct ?
If written a VB App that creates an xml file. Is the next step to pass the values to an ASP file? If thats the case, can i pass the entire xml file as an object or do i need to pass the values as individual parameters? [] .. or
[]
Secondly, the XML file will be local to the client but the ASP page on my remote webserver, can i still pass the xml file/values? This is all very new to me, so to stop me bugging you all, do you know of any tutorials that deal with this. I could not find any on the web.

Thankyou once again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top