EasyCFM.COM ColdFusion Forums / ASP to CFML / help converting ASP to CFML - connection code

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: help converting ASP to CFML - connection code -- page: 1 2 3

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

MikeCFM7
03-06-2007 @ 3:45 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 22
Joined: Mar 2007

It has been a few days so I can't remember what their confirmation said but I do remember it said successful.  If I am remembering correctly I did not have my database uploaded and in fact I don't think there was a directory "Access_db" until after I had finished the DSN setup.
So, I guess I need to try their setup again while my database is there, right?
Question

You are appreciated.
Mike

mquack
03-06-2007 @ 3:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

Well, let's put it this way: it's physically impossible to setup a DSN without a database to connect to.  Smile

www.rachelqueensg.com
Amazon Wish List

MikeCFM7
03-06-2007 @ 4:15 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 22
Joined: Mar 2007

Makes me wonder what GoDaddy means by "setup successful".
I will try to redo the setup and then post the results.  I need some time to play around as I continue trying to learn.
Thanks, easycfm has helped more in a few minutes than GoDaddy has in weeks.

You are appreciated.
Mike

JJfutbol
03-06-2007 @ 6:32 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1250
Joined: Nov 2004

Just to add after seeing Mike's code you were missing pound signs around the datasource variable you created and specified in the cfquery tag. So for example you should have this:

<cfset datasource = "database_01">
<cfquery name="getBible1" datasource="#datasource#"...

instead of this:

<cfset datasource = "database_01">
<cfquery name="getBible1" datasource="datasource"...

The first example CF knows anything within pound signs is some sort of expression or variable. In this case we want to output the value of the variable called datasource. What's wrong in the second example is that your saying the datasource name is actually "datasource" instead of "database_01". Just wanted to make sure that was clear.

...Just so you know, the secret word for this post was "drunks". Quite descriptive of those involved here. Smile

----------------------------------------------------
Some free CF applications available at my site, such as the popular CFC Validator www.javier-julio.com My new site design is up!! Let me know what you all think! Working on a fully accessible Forum, which validates as full CSS and XHTML 1.0 Strict.

mquack
03-06-2007 @ 6:36 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1544
Joined: Jan 2005

quote:

Just so you know, the secret word for this post was "drunks". Quite descriptive of those involved here.

I occasionally resemble that remark.  Evil Grin

www.rachelqueensg.com
Amazon Wish List

MikeCFM7
03-07-2007 @ 10:09 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 22
Joined: Mar 2007

Thanks JJ, I remember reading how easy it is to forget the #'s in cf code and I need to be reminded.

You are appreciated.
Mike

JJfutbol
03-07-2007 @ 10:14 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1250
Joined: Nov 2004

Sure Mike no problem. I just wanted to make sure if you were using that code that and that everything on the server side was correctly setup the query wouldn't work because of that. Don't worry soon enough you'll remember to use the # signs. I say that but I can't even remember what it was like for me. I'm sure I was far worse. Smile

----------------------------------------------------
Some free CF applications available at my site, such as the popular CFC Validator www.javier-julio.com My new site design is up!! Let me know what you all think! Working on a fully accessible Forum, which validates as full CSS and XHTML 1.0 Strict.

MikeCFM7
03-07-2007 @ 12:03 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 22
Joined: Mar 2007

I think I am connected to my access mdb file.  This is my latest error as I go bumbling along:

Error Executing Database Query.  
The Microsoft Jet database engine cannot find the input table or query 'tbl_Bible1'. Make sure it exists and that its name is spelled correctly.  
  
The error occurred in D:\Hosting\michael37\get_data.cfm: line 8

6 : </head>
7 : Test Bible1 database
8 : <cfquery name="Bible1" datasource="#datasource#">
9 : SELECT ID
10 :      FROM tbl_Bible1


--------------------------------------------------------------------------------

SQL    SELECT ID FROM tbl_Bible1 WHERE ID = 2  
DATASOURCE   michael37_accesscf_Bible1
VENDORERRORCODE   3127
SQLSTATE    

-------------
I called everything Bible1 to make it easy to remember.  Bible1.mdb, table is also Bible1 but error says it can't find it?



You are appreciated.
Mike

JJfutbol
03-07-2007 @ 12:11 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1250
Joined: Nov 2004

Thats great news as that means its making the connection to the database! Now for the easy part. In your query you are saying grab this data from a table named "tbl_Bible1" but at the end of your post you claim you named the database table "Bible1".

The secret word for this post was... disobey. Smile  ...I tried to think of a smart alec comment but can't think of any so you got lucky Mike! Wink

----------------------------------------------------
Some free CF applications available at my site, such as the popular CFC Validator www.javier-julio.com My new site design is up!! Let me know what you all think! Working on a fully accessible Forum, which validates as full CSS and XHTML 1.0 Strict.

MikeCFM7
03-07-2007 @ 12:56 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 22
Joined: Mar 2007

Yeah!  I am connected now with no errors.  

Note:  see the thank you note in the following post.  I screwed up and did 2 posts.  Now I am going to run before the moderator gets me.

You are appreciated.
Mike Scared

This message was edited by MikeCFM7 on 3-7-07 @ 2:53 PM

PAGE: 1 2 3

Website Designed and Developed by Pablo Varando.