databases and godaddy.com - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

databases and godaddy.com

seanconnseanconn Posts: 1Member
Hello everyone. I am a student who is trying to figure this ASP.net out while using GoDaddy as my host. I was taught how to use asp.net using my local host while testing it. But when I want to implement it through GoDaddy, I have to copy and paste something that they give me. Below is what they have

<%
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server

db_server = "mysql.secureserver.net"
db_name = "your_dbusername"
db_username = "your_dbusername"
db_userpassword = "your_dbpassword"
fieldname = "your_field"
tablename = "your_table"

connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr

qry = "SELECT * FROM " & tablename

Set oRS = oConn.Execute(qry)

if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "<br>"
oRS.movenext
wend
oRS.close
end if

Set oRs = nothing
Set oConn = nothing

%>

Now I created the database through godaddy already and just need some help trying to figure this all out. I also have to create a new datasource and am trying to figure out what the connection string is going to look like since its not on my machine. I also need to know where the above code gets pasted. They don't teach you all that you need to know and now I am asking you all to help me learn some more about asp.net.
I seriously need help and hope someone is patient enough to help me. Thanks for your time.

Comments

  • bradwangbradwang Posts: 197Member
    : Hello everyone. I am a student who is trying to figure this ASP.net
    : out while using GoDaddy as my host. I was taught how to use asp.net
    : using my local host while testing it. But when I want to implement
    : it through GoDaddy, I have to copy and paste something that they
    : give me. Below is what they have
    :
    : <%
    : Dim oConn, oRs
    : Dim qry, connectstr
    : Dim db_name, db_username, db_userpassword
    : Dim db_server
    :
    : db_server = "mysql.secureserver.net"
    : db_name = "your_dbusername"
    : db_username = "your_dbusername"
    : db_userpassword = "your_dbpassword"
    : fieldname = "your_field"
    : tablename = "your_table"
    :
    : connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server &
    : ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" &
    : db_userpassword
    :
    : Set oConn = Server.CreateObject("ADODB.Connection")
    : oConn.Open connectstr
    :
    : qry = "SELECT * FROM " & tablename
    :
    : Set oRS = oConn.Execute(qry)
    :
    : if not oRS.EOF then
    : while not oRS.EOF
    : response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) &
    : "<br>"
    : oRS.movenext
    : wend
    : oRS.close
    : end if
    :
    : Set oRs = nothing
    : Set oConn = nothing
    :
    : %>
    :
    : Now I created the database through godaddy already and just need
    : some help trying to figure this all out. I also have to create a new
    : datasource and am trying to figure out what the connection string is
    : going to look like since its not on my machine. I also need to know
    : where the above code gets pasted. They don't teach you all that you
    : need to know and now I am asking you all to help me learn some more
    : about asp.net.
    : I seriously need help and hope someone is patient enough to help me.
    : Thanks for your time.
    :


    Hello, I think you are not using ASP.NET but classic ASP in your code.

    I think you should make sure this part of your code is configured correctly by following Goddady.com's settings:

    db_server = "mysql.secureserver.net"
    db_name = "your_dbusername"
    db_username = "your_dbusername"
    db_userpassword = "your_dbpassword"
    fieldname = "your_field"
    tablename = "your_table"

    Hope this helps, and I suggest you to learn ASP.NET rather than ASP since ASP is too old and outdated. ASP.NET is a lot more fun and easy to go with. :)



    Brad Wang
    .NET Freelancer from China
Sign In or Register to comment.