|
-
Aug 16th, 2004, 10:54 AM
#1
Thread Starter
New Member
Please need help a simple question
I wana know how i can acess a Database from SQL of my friend's server, what the code i use...please write below.
And if i wanna do ''whos is online in the server'' in a homepage how i can do it....please write the code below especifing.
PLEASE I need it , if you do..i'll thank you!
-
Aug 17th, 2004, 12:58 AM
#2
-
Aug 17th, 2004, 08:12 PM
#3
Thread Starter
New Member
thanks...if somebody wants to explain better, i will thank
-
Aug 17th, 2004, 08:37 PM
#4
Originally posted by Crawlerz
thanks...if somebody wants to explain better, i will thank
You need to explain yourself better and be more specific, your question is slightly vauge.
Firstly if you wanna connect to a remote SQL Server you do it so by using the IP and the port No of the server. Look up the connection string for remote connection in http://www.able-consulting.com/ADO_Conn.htm.
As for who is online, there is many wasy you can do it, If you are using ASP then you can do so using Application variable and increment/decrement a Counter variable when a new session is started/ended. Search on 4GuysFromRolla.com you should find many example.
Hope this helps.
Danial
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Aug 20th, 2004, 08:57 PM
#5
Thread Starter
New Member
help
HELP PLEASE - im only trying to acess a simple SQL server...nut its not simple for me. need help please.
Help im getting this error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30037: Character is not valid.
Source Error:
Line 2: <script runat="server">
Line 3:
Line 4: <%
Line 5: Set Conn = Server.CreateObject("ADODB.Connection")
Line 6: Conn.open "DSN=felipeiron.no-ip.com;UID=mine;PWD=mine;DATABASE=MEMB_STAT"
-------------------------------------------------------------------
and my code is:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=felipeiron.no-ip.com;UID=mine;PWD=mine;DATABASE=MEMB_STAT"
strSQL = "SELECT * memb stats"
conn.Open strConexao
rs.Open strSQL, conn
Do While Not rs.EOF
Response.Write rs.Fields("memb stats").Value & "<br>"
Loop
%>
----------------------------------------------------------
and i dunno what can i put in ''DATABASE='' in the code
and ''SELECT * '' too
-
Aug 20th, 2004, 09:13 PM
#6
Conn.open "DSN=felipeiron.no-ip.com;UID=mine;PWD=mine;DATABASE=MEMB_STAT"
strSQL = "SELECT * memb stats"
conn.Open strConexao
Why are you opening 2 Connections? This maybe your problem. Otherwise your code looks ok.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 21st, 2004, 11:17 PM
#7
Thread Starter
New Member
help
ok I erased that ...but the error persist
-----------------------------------------------------
now the code is:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=felipeiron.no-ip.com;UID=mine;PWD=mine;DATABASE=MEMB_STAT"
strSQL = "SELECT * memb stats"
rs.Open strSQL, conn
Do While Not rs.EOF
Response.Write rs.Fields("memb stats").Value & "<br>"
Loop
%>
-
Aug 22nd, 2004, 08:24 AM
#8
Do you have a DSN setup on the machine that you are executing this code? If so, what happens when you click on the test connection button in the DSN?
Sent from my Treo 600
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 22nd, 2004, 10:41 AM
#9
Thread Starter
New Member
May I explain it to you...Im trying to acess a SQL server of my friend, Im only the ''webmaster'' that want to acess it for him from a home page.
Im doing a benefit for him.
I have the DSN, the name of the Table and SQL server, so what code i have to use, what type of code? ASP? if its ASP i using it.
HELP ME ANYONE please.
-
Aug 22nd, 2004, 05:15 PM
#10
Have you tested the dsn? I am sure that you probably know this already but the you have to define the dsn on your machine. If that works then I don't know what problem is
Last edited by Mark Gambo; Aug 22nd, 2004 at 06:27 PM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 22nd, 2004, 05:28 PM
#11
Thread Starter
New Member
i think DSN is the IP of the Server, isnt it?
-
Aug 22nd, 2004, 06:25 PM
#12
i think DSN is the IP of the Server, isnt it?
No the Data Source Name or DSN for short provides connectivity to a database through an ODBC driver. The DSN contains database name, directory, database driver, UserID, password, and other information. Once you create a DSN for a particular database, you can use the DSN in an application to call information from the database.
There are three types of DSNs:
(1) System DSN -- can be used by anyone who has access to the machine. DSN info is stored in the registry.
(2) User DSN -- created for a specific user. Also stored in the registry.
(3) File DSN -- DSN info is stored in a text file with .DSN extension.
DSN is often used by Active Server Pages (ASP) and Visual Basic programs when a query to a database is necessary to retrieve information.
There is also what is known as a "DSN-less connection." Instead of using a DSN to connect to a database, the developer specifies the necessary information right in the application. With a DSN-less connection the developer is free to use connection standards other than ODBC, such as OLE DB.
Check out this links:
Setting Up a System DSN
Creating a Local DSN
Setting up a System DSN
How to create a System DSN for Microsoft SQL Server[QUOTE]
Last edited by Mark Gambo; Aug 22nd, 2004 at 06:28 PM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 23rd, 2004, 03:38 PM
#13
Thread Starter
New Member
hey, i did a conection to a sql server below, but i have to put it on a .asp page?? or html?? or .jsp??
when i put it there, on the page, in my case the member satus will open??? the code below is correct???
-----------------------------------
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=felipeiron.no-ip.com;UID=mine;PWD=mine;DATABASE=MEMB_STAT"
strSQL = "SELECT * memb stats"
rs.Open strSQL, conn
Do While Not rs.EOF
Response.Write rs.Fields("memb stats").Value & "<br>"
Loop
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|