PDA

View Full Version : SQL database problem


BarrMan
05-25-2006, 01:26 PM
Hi, I have a problem reading from the sql database on a site i got access to.
this is my code:
con.open "PROVIDER=SQLOLEDB;DATA SOURCE=mysql2.siteam.co.il;UID=hoops_admin1;PWD=db123;DATABASE=hoops_db1"
the site which reads from this database is fine but when i'm trying to read from it in my localhost i get this error:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/hoops.co.il/includs/DBcon.asp, line 6

Can anyone help me please?

degsy
05-25-2006, 03:53 PM
What do you mean by localhost?

Do you mean your home PC or the Server/Webhost?

I would suspect if you are trying to access it from a PC not on the same network then you will get the access denied error.

BarrMan
05-25-2006, 05:33 PM
It's from my localhost at my pc.
I can get the .sql database to my computer but i still don't know how to read it because i need a server or something.

Thanks for your help!

BarrMan
05-26-2006, 11:01 AM
Anyone? Please help me.

Spudhead
05-26-2006, 02:14 PM
can get the .sql database to my computer

What, exactly, are you getting here? You're... downloading a file? A file with a ".sql" extension?

If it's a SQL file, then presumably it's a script for generating the tables, etc. that your database consists of. Post the SQL and we'll know for sure.

You're right, you need a database server running on your local machine. Luckily, you can get free, developer editions of Microsoft's SQL Server for this very purpose. Google for more details.

Once you've got an instance of SQL Server running on your local machine, you can simply run the SQL file that you've got and recreate your live database. You might not have the actual data, but you can import it.

Does that help?

BarrMan
05-26-2006, 02:40 PM
Yea it helps, Thanks alot! but i had some problems installing the sql server..
do you have aim or messanger so we could talk instantly? cuz i don't think i can explain this in here... it would take years...
Thanks alot for the help...
I'd appriciate if you helped me there... Thanks.

ghell
05-26-2006, 04:24 PM
www.connectionstrings.com if you are using sql server 2005 from the same machine you need to use (local) as the datasource, and remote connections are disabled by default. the following is an asp dsnless connection i have to a MSSQL2005 (x64) on the same machine:

"provider=sqloledb;driver={sql server};server=(local);database=...;uid=...;pwd=...;"

it should work for other versions of sql server too. You may wish to use SQL Native Client if you have 2005 (i dont know any advantages it has etc so i cant say for sure)

connecting to an external machine is usually done with server=1.2.3.4,1433 or whatever.

BarrMan
05-27-2006, 09:54 PM
So i need to install sql server on my machine? if so, I've installed an sql server already on my computer but i don't know how to use it.
How can i read from the file using the connection string because it does an error.
Is there any way to read from the database that is located on a site? Thanks.

BarrMan
05-29-2006, 01:47 PM
help me please. :(

degsy
05-31-2006, 03:27 PM
Have you asked the host?
Have you told them that you are trying to access the SQL Server from your home PC.

I think I know what their answer will be.

ghell
05-31-2006, 05:01 PM
Why are there 2 threads for the same question from the same person anyway?
http://www.codingforums.com/showthread.php?p=450224

(I do actually have a theory for why there are 2 threads that revolves around something in the connection string but I'd rather not share it it would only offend someone.)

No material in this post sorry, just pointing out dont post the same question twice :rolleyes:

BarrMan
05-31-2006, 06:12 PM
hehe :P.
the reason is because when people see the thread has been answered already they don't bother checking if it has really been solved (at least this is how i think) so i made the other post because there has been a few days when no one has answered me in the old thread (this one).

ghell
05-31-2006, 07:46 PM
You also keep bumping your post up with annoying htings like
please

somebody help me

or my personal favourite so far:
...





cos that REALLY makes people want to help you ¬_¬

BarrMan
05-31-2006, 08:01 PM
lol..