very rookie VBScript ADO RDS Binding question

G

gwmarbach

Looking at what is posted here, I'm afraid this will be a real dumb thing to ask (I'm just getting into web programming after having worked in mainframe programming for a long time).

I'm learning about ADO RDS Binding. My (simple) web page finally has been made to successfully retrieve a little data from my sample database (which has a "songs" table and a "users" table - joinable on a field called "username").

I'm now trying to persist the extracted recordset (eventually in XML and in a "stream") and to make a user fiendish (oops - I meant "friendly") "table" with sortable column headers and all that...

To help me learn about the topic, I found a very interesting MSDN article that had a great looking VBScript at the bottom. The idea of the script is to present form input fields via the page and you can override defaulted connection info and have the script draw you a simple "table" from one of your database tables...

Well - I can't get the VBScript to work... I get the form inputs to show up just fine but when I click the "run" button, nothing seems to really happen (and I sure don't get my MS Access info displayed in a "table" on the screen like is supposed to happen). So, my question is "can someone coach me as to how to get the script really to work?" I can share where to find version of the script if that would help.

The MDSN article is at: (except for very minor tailoring like putting my column names in where they had different columns, my script is exactly like the one in the article)http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdobjaddataconx.asp


Some of my connection info is as follows:

' CONNECTION STRING
DataBasePath = Server.MapPath("..\db\fpdb\srtestdb.mdb")
DatBaseDriver = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
DataBaseSource = DatBaseDriver & DataBasePath

' CONNECTION
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open(DataBaseSource)

' Create an ADO recordset object
Set rsSRDB = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT [songs].[songtitle], [songs].[songgenre], [songs].[songusername],
[users].[username], [users].[emailaddr] FROM users LEFT JOIN songs ON [users].[username]
=[songs].[songusername];"

' Open the recordset with the SQL query
rsSRDB.Open strSQL, DBConn



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
C

Cor Ligthert

Hi Gary,

Because that you are a Rookie, you can leave ADO quick behind you.
It is the previous version for dataconnection and handling and completly
different from ADONET.

However there is a great start for you in the SDK net 1.1 and I think there
is time enough for you to change to that and get quicker results.


http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en

A lot of samples how to resolve your problem, however not ADO.
(You need Net 1.1 on your webserver)

I hope this helps?

Cor







gary marbach said:
Looking at what is posted here, I'm afraid this will be a real dumb thing
to ask (I'm just getting into web programming after having worked in
mainframe programming for a long time).
I'm learning about ADO RDS Binding. My (simple) web page finally has been
made to successfully retrieve a little data from my sample database (which
has a "songs" table and a "users" table - joinable on a field called
"username").
I'm now trying to persist the extracted recordset (eventually in XML and
in a "stream") and to make a user fiendish (oops - I meant "friendly")
"table" with sortable column headers and all that...
To help me learn about the topic, I found a very interesting MSDN article
that had a great looking VBScript at the bottom. The idea of the script is
to present form input fields via the page and you can override defaulted
connection info and have the script draw you a simple "table" from one of
your database tables...
Well - I can't get the VBScript to work... I get the form inputs to show
up just fine but when I click the "run" button, nothing seems to really
happen (and I sure don't get my MS Access info displayed in a "table" on the
screen like is supposed to happen). So, my question is "can someone coach
me as to how to get the script really to work?" I can share where to find
version of the script if that would help.
The MDSN article is at: (except for very minor tailoring like putting my
column names in where they had different columns, my script is exactly like
the one in the
article)http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado
270/htm/mdobjaddataconx.asp
Some of my connection info is as follows:

' CONNECTION STRING
DataBasePath = Server.MapPath("..\db\fpdb\srtestdb.mdb")
DatBaseDriver = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
DataBaseSource = DatBaseDriver & DataBasePath

' CONNECTION
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open(DataBaseSource)

' Create an ADO recordset object
Set rsSRDB = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT [songs].[songtitle], [songs].[songgenre], [songs].[songusername],
[users].[username], [users].[emailaddr] FROM users LEFT JOIN songs ON [users].[username]
=[songs].[songusername];"

' Open the recordset with the SQL query
rsSRDB.Open strSQL, DBConn



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
G

gwmarbach

Thank you, Cor. My web host says that we do have ADONET 1.1 available. I will try to use it by first looking at the Microsoft download that you suggest.

I hope that there are many jscript, javascript and especially VBScript examples ... I don't have real robust software packages or knowledge. I'm trying to just learn the basics with "scripting" right now. But I have found that you can do all sorts of things with it.

Would you be okay with my asking more questions once I've looked at the examples? Or, should I seek another reference point for information? (I'm sure I'll have more questions.)

Thanks again.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
C

Cor Ligthert

Hi Gary,

When you use that and you use ASPX than this is the right groups for the
dataaccess part and the newsgroup where this SDK is mostly talked about is

microsoft.public.dotnet.framework.aspnet

(However it is not VBS scripting it is more ASPX scripting what is mostly
the same as VB.Net or if you want that C#.)

Do not be afraid, the samples are really very good in that SDK and not more
complicated to use than VBS which will be in my opinion a time an old and
probably a dead scripting language.

Javascript you will keep using in this way, however that is also often in
the newsgroup I pointed you on.

I hope this helps?

Cor
 
G

gwmarbach

Okay. Sounds like you are suggesting that I continue to post questions to this message board and that I move away from VBScript and toward javascript. Is that right?

I have looked at the download and it first requires me to do a different download ... and both are huge.

I will give it a try. Thank you.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
C

Cor Ligthert

Hi Gary,
Okay. Sounds like you are suggesting that I continue to post questions to
this message board and that I move away from VBScript and toward javascript.
Is that right?

Aspx script for serverside (VB.net and C#)
JavaScript for clientside,

When you have download the SDK I think that you will understand direct what
I mean.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top