Solved

Connection string conversion

Posted on 2013-06-07
2
1,615 Views
Last Modified: 2013-06-07
I have a need to connect to an IP21 server and pull data from it and post it to the web. there is currently a VB progrm that runs and pull some data and the connection string that program uses is as follows:
'Dimension the connection string and odbc command.

Dim StrConn As String = "Driver={AspenTech SQLPlus};HOST=" & HostName & ";PORT=10014"

Dim oCmd As New System.Data.Odbc.OdbcCommand

Dim IntegerIndex As Integer

'Create and open the connection to the server.

oCmd.Connection = New System.Data.Odbc.OdbcConnection(StrConn)

oCmd.Connection.Open()

'Execute the SQL command.

oCmd.CommandText = SqlCommand

Open in new window


what i need to do is figure out how to make this connection string work in an ASP webpage. can someone help me with that?
0
Comment
Question by:jlcannon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
omgang earned 500 total points
ID: 39229283
Try in your ASP page

<%
Dim conn, rs

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={AspenTech SQLPlus};HOST=TheHostName;PORT=10014"

conn.open

set rs=conn.Execute(SqlCommand)

%>

Will you still need to pass the host name dynamically?  If so, You'll need to add to the script a method to obtain the host name into a variable and then use the variable in the connection string assignment just like in the VB program.

OM Gang
0
 

Author Closing Comment

by:jlcannon
ID: 39229319
no need to pass host dynamically since it is a single host and will not change i can just hard code it. Thank you!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hide Table in merge 3 53
SQL to JSON 14 65
VB6 - Check if date format = "MM/DD/YYYY' and check if date also exist 23 79
ms sql and asp dates 5 43
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question