Solved

Connection string conversion

Posted on 2013-06-07
2
1,650 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

635 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