Sunday, March 25, 2012
Cannot drop the database 'RMAModule' because it is currently in use
dynamically?
I am using this code...
DROP DATABASE RMAModule
If I just wait a while and try it again it will work - not urgent, but a
hastle. Thanks!!Hi,
Execute the below code from Query Analyzer,
use master
go
alter database dbname set RESTRICTED_USER with rollback immediate
go
drop database dbname
Replace the dbname with the actual dbname which you have to drop.
Thanks
Hari
MCDBA
"michaaal" <res0gyio@.verizon.net> wrote in message
news:#EwrBBlDEHA.2424@.TK2MSFTNGP09.phx.gbl...
> How can I stop getting this error when I try to delete a database
> dynamically?
> I am using this code...
> DROP DATABASE RMAModule
> If I just wait a while and try it again it will work - not urgent, but a
> hastle. Thanks!!
>sql
Sunday, March 11, 2012
Cannot Create Assembly
I'm using SQL Server Management Studio Express and am unable to create an assembly. The following code:
create assembly HelloWorld from 'c:\HelloWorld.dll'
with permission_set = safe
returns the following error:
Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'assembly'.
I noticed that the word "assembly" isn't in blue text and what's more, if I expand the programmability node on any database, there is no assembly node. Anybody know what I'm doing wrong here?
Thanks in advance.
You are either not connected to a SQL Server 2005 instance or have the compability level to 80 or lower. (Which does not support assemblies / assembly keywords)Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Thank you Jens. I'm pretty new to this, and compatability level is something I've never heard of before. Could you fill me in on how to change that or point me to a link. Much obliged.
Thursday, March 8, 2012
Cannot create a row of size 8075 which is greater than... (-214721
I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box that
sometimes fails when trying to update an ADO field type of adLongVarChar
(stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
mode) and produces the following error:
Error Number: -21472179
Error Description: Cannot create a row of size 8075 which is greater than
the allowable maximum of 8060.
The error seems to be occurring when we try to update the field with a large
string value. The strange thing is that it works without producing an error
sometimes. The reason I say this is that I can see some entries in my table
that have a DATALENGTH of the text field much larger than some of the ones
that are failing.
My VB6/ADO code looks like so:
'inserts a new record into a table with default values
sql = "call mydatadatable_insert "
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
myID= objRecordset.Fields.Item("ID").Value
objRecordset.Close
Set objRecordset = Nothing
'loads a 23 KB xml file
sXML = ReadFile("c:\temp\test.xml")
'...more processing here (non database)
sql = "exec mydatadatable_update" & cstr(myID)
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
'this is the problem area!!
objRecordset.Fields("FileTxt").Value = sXML
objRecordset.Update
objRecordset.Close
Set objRecordset = Nothing
I was thinking it might have something to do with the reference to ADO 2.5,
rather than 2.8 which is what comes with Windows Server 2003. But again, it
seems to be working some of the time.
I found this article on Microsoft's site:
http://msdn.microsoft.com/library/d...serr_1_20hd.asp
Any help would be greatly appreciated!!!
Thanks in advance!
Brian McCulloughHi,
After reading your post I have one question.
Is XML file always the same size?
My opinion is that sometimes XML file (or string) is small enough to fit
into varchar (which I think you're using for data-type) and sometimes it os
too large (8075).
You could generaly solve the problem with using text or ntext as a datatype
in the affected column.
Danijel
"brianpmccullough" <bmccullough11@.comcast.net> wrote in message
news:593E87AE-3407-4ACB-9908-7F5A8969EAB8@.microsoft.com...
> Hello all,
> I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box
> that
> sometimes fails when trying to update an ADO field type of adLongVarChar
> (stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
> mode) and produces the following error:
> Error Number: -21472179
> Error Description: Cannot create a row of size 8075 which is greater than
> the allowable maximum of 8060.
> The error seems to be occurring when we try to update the field with a
> large
> string value. The strange thing is that it works without producing an
> error
> sometimes. The reason I say this is that I can see some entries in my
> table
> that have a DATALENGTH of the text field much larger than some of the ones
> that are failing.
> My VB6/ADO code looks like so:
> 'inserts a new record into a table with default values
> sql = "call mydatadatable_insert "
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> myID= objRecordset.Fields.Item("ID").Value
> objRecordset.Close
> Set objRecordset = Nothing
> 'loads a 23 KB xml file
> sXML = ReadFile("c:\temp\test.xml")
> '...more processing here (non database)
> sql = "exec mydatadatable_update" & cstr(myID)
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> 'this is the problem area!!
> objRecordset.Fields("FileTxt").Value = sXML
> objRecordset.Update
> objRecordset.Close
> Set objRecordset = Nothing
>
> I was thinking it might have something to do with the reference to ADO
> 2.5,
> rather than 2.8 which is what comes with Windows Server 2003. But again,
> it
> seems to be working some of the time.
> I found this article on Microsoft's site:
> http://msdn.microsoft.com/library/d...serr_1_20hd.asp
> Any help would be greatly appreciated!!!
> Thanks in advance!
> Brian McCullough
Cannot create a row of size 8075 which is greater than... (-214721
I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box that
sometimes fails when trying to update an ADO field type of adLongVarChar
(stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
mode) and produces the following error:
Error Number: -21472179
Error Description: Cannot create a row of size 8075 which is greater than
the allowable maximum of 8060.
The error seems to be occurring when we try to update the field with a large
string value. The strange thing is that it works without producing an error
sometimes. The reason I say this is that I can see some entries in my table
that have a DATALENGTH of the text field much larger than some of the ones
that are failing.
My VB6/ADO code looks like so:
'inserts a new record into a table with default values
sql = "call mydatadatable_insert "
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
myID= objRecordset.Fields.Item("ID").Value
objRecordset.Close
Set objRecordset = Nothing
'loads a 23 KB xml file
sXML = ReadFile("c:\temp\test.xml")
'...more processing here (non database)
sql = "exec mydatadatable_update" & cstr(myID)
Set objRecordset = New ADODB.Recordset
objRecordset.CursorLocation = adUseClient
Call objRecordset.Open(sql, objConnection, adOpenKeyset, adLockOptimistic)
'this is the problem area!!
objRecordset.Fields("FileTxt").Value = sXML
objRecordset.Update
objRecordset.Close
Set objRecordset = Nothing
I was thinking it might have something to do with the reference to ADO 2.5,
rather than 2.8 which is what comes with Windows Server 2003. But again, it
seems to be working some of the time.
I found this article on Microsoft's site:
http://msdn.microsoft.com/library/de...err_1_20hd.asp
Any help would be greatly appreciated!!!
Thanks in advance!
Brian McCullough
Hi,
After reading your post I have one question.
Is XML file always the same size?
My opinion is that sometimes XML file (or string) is small enough to fit
into varchar (which I think you're using for data-type) and sometimes it os
too large (8075).
You could generaly solve the problem with using text or ntext as a datatype
in the affected column.
Danijel
"brianpmccullough" <bmccullough11@.comcast.net> wrote in message
news:593E87AE-3407-4ACB-9908-7F5A8969EAB8@.microsoft.com...
> Hello all,
> I have some VB6 code using ADO 2.5 running on a Windows 2003 Server box
> that
> sometimes fails when trying to update an ADO field type of adLongVarChar
> (stored as a text column in a SQL Server 2000 database, 6.5 compatiblity
> mode) and produces the following error:
> Error Number: -21472179
> Error Description: Cannot create a row of size 8075 which is greater than
> the allowable maximum of 8060.
> The error seems to be occurring when we try to update the field with a
> large
> string value. The strange thing is that it works without producing an
> error
> sometimes. The reason I say this is that I can see some entries in my
> table
> that have a DATALENGTH of the text field much larger than some of the ones
> that are failing.
> My VB6/ADO code looks like so:
> 'inserts a new record into a table with default values
> sql = "call mydatadatable_insert "
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> myID= objRecordset.Fields.Item("ID").Value
> objRecordset.Close
> Set objRecordset = Nothing
> 'loads a 23 KB xml file
> sXML = ReadFile("c:\temp\test.xml")
> '...more processing here (non database)
> sql = "exec mydatadatable_update" & cstr(myID)
> Set objRecordset = New ADODB.Recordset
> objRecordset.CursorLocation = adUseClient
> Call objRecordset.Open(sql, objConnection, adOpenKeyset,
> adLockOptimistic)
> 'this is the problem area!!
> objRecordset.Fields("FileTxt").Value = sXML
> objRecordset.Update
> objRecordset.Close
> Set objRecordset = Nothing
>
> I was thinking it might have something to do with the reference to ADO
> 2.5,
> rather than 2.8 which is what comes with Windows Server 2003. But again,
> it
> seems to be working some of the time.
> I found this article on Microsoft's site:
> http://msdn.microsoft.com/library/de...err_1_20hd.asp
> Any help would be greatly appreciated!!!
> Thanks in advance!
> Brian McCullough
Wednesday, March 7, 2012
Cannot Convet Sql image to Byte[]
I am somewhat confused because the INSERT statement for your upload process only contains 4 parameters (even though 5 parameters are specified). So my guess is that the image is not gettng into the database (and is therefore NULL), and that is why you are getting the exception on the download portion?
//
// sqlUploadImage
//
this.sqlUploadImage.CommandText = "INSERT INTO Image_Table (Description, Type, Lenth, DocName) VALUES (@.Description," +
" @.Type, @.Length, @.DocName)";
this.sqlUploadImage.Connection = this.sqlConnection2;
this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Description", System.Data.SqlDbType.VarChar, 50, "Description"));
this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Type", System.Data.SqlDbType.VarChar, 50, "Type"));
this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Length", System.Data.SqlDbType.Int, 4, "Lenth"));
this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.DocName", System.Data.SqlDbType.VarChar, 50, "DocName"));
this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Image", System.Data.SqlDbType.Image, 16, "ImgField"));
this.Button2.Click += new System.EventHandler(this.Button2_Click);
//
// sqlDownLoadImage
//
this.sqlDownLoadImage.CommandText = "SELECT Image_Table.* FROM Image_Table";
this.sqlDownLoadImage.Connection = this.sqlConnection2;//upload file
private void Button1_Click(object sender, System.EventArgs e)
{
//Get the filename of the pdf file to be uploaded.
string strFilename = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") +1);//Get the file type
string strFileType = File1.PostedFile.ContentType;//Get the file size
int intImageSize = File1.PostedFile.ContentLength;// Reads the Image
Stream ImageStream = File1.PostedFile.InputStream;byte[] ImageContent = new byte[intImageSize + 1];
int intStatus = 0;
intStatus = ImageStream.Read(ImageContent, 0, intImageSize);//Response.Write(strFilename.ToString());
//Response.Write("<br>Image Type: " + strFileType.ToString());
//Response.Write("<br>Image Size: "+intImageSize.ToString());this.sqlUploadImage.Parameters["@.Description"].Value = strFilename;
this.sqlUploadImage.Parameters["@.Type"].Value = strFileType;
this.sqlUploadImage.Parameters["@.Length"].Value = intImageSize;
this.sqlUploadImage.Parameters["@.DocName"].Value = "TestPDF";
this.sqlUploadImage.Parameters["@.Image"].Value = ImageContent;try
{
this.sqlConnection2.Open();
this.sqlUploadImage.ExecuteNonQuery();this.Label2.Text = "File Uploaded Successfully";
this.Button2.Visible = true;
}
catch(SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
this.sqlConnection2.Close();
}
}//download file
private void Button2_Click(object sender, System.EventArgs e)
{
try
{
this.sqlConnection2.Open();
SqlDataReader r = this.sqlDownLoadImage.ExecuteReader(CommandBehavior.CloseConnection);if(r.Read())
{Response.ContentType = r["Type"].ToString();
byte[] image = (byte[])r["ImgField"];
Response.BinaryWrite(image);
}
}
catch(SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
this.sqlConnection2.Close();
}
}
Terri|||Thanks for the reply, but there are 5 parameters.
I have double check the database and all information is there for the upload and all information is valid.
The problem is on the download.
byte[] image = (byte[])r["ImgField"];
throughs an invalid cast.... I have found many articles using this exact cast.|||HOly cow, I see it now.
only 4 parameters.
let me see if i change itl|||ok fixed my insert string.
Now I have verifity there is nothing being uploaded to hte ImgField... it is DBNULL.|||Why are you adding 1 to the image file size when dimensioning the byte array? I thought the size of the byte array should match the file size?
byte[] ImageContent = new byte[intImageSize];
Terri|||Yes, fixed that also.
Ok it uploads now.
BUT, when I download I get just the binary information to output. And it doesn't output on in the browser but in a new webform.
any ideas?
Updated code here
|||Ok, if I am working with photos, jpeg, gif etc.. the above code works great. But I need to store and view pdf files and this code is not working for that type of application/pdf
//
// sqlConnection2
//
this.sqlConnection2.ConnectionString = ((string)(configurationAppSettings.GetValue("sqlConnection2.ConnectionString", typeof(string))));
//
// sqlDownLoadImage
//
this.sqlDownLoadImage.CommandText = "SELECT Image_Table.* FROM Image_Table";
this.sqlDownLoadImage.Connection = this.sqlConnection2;
//
// sqlCommand1
//
this.sqlCommand1.CommandText = "SELECT ImgField, Type FROM Image_Table WHERE (ImageID = 1)";
this.sqlCommand1.Connection = this.sqlConnection2;
this.Load += new System.EventHandler(this.Page_Load);}
#endregion//upload file
private void Button1_Click(object sender, System.EventArgs e)
{
//Get the filename of the pdf file to be uploaded.
string strFilename = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") +1);//Get the file type
string strFileType = File1.PostedFile.ContentType;//Get the file size
int intImageSize = File1.PostedFile.ContentLength;//Reads teh image
Stream imgStream = File1.PostedFile.InputStream;byte[] ImageContent = new byte[intImageSize];
int intStatus = imgStream.Read(ImageContent, 0, intImageSize);//Response.Write(strFilename.ToString());
//Response.Write("<br>Image Type: " + strFileType.ToString());
//Response.Write("<br>Image Size: "+intImageSize.ToString());SqlCommand sqlUpload = new SqlCommand("INSERT INTO Image_Table(Description, ImgField, Type, Lenth, DocName)" +
"VALUES (@.Description, @.Image, @.Type, @.Length, @.DocName)", this.sqlConnection2);SqlParameter param0 = new SqlParameter("@.Description", SqlDbType.VarChar, 50);
param0.Value = strFilename;
sqlUpload.Parameters.Add( param0 );SqlParameter param1 = new SqlParameter("@.Image", SqlDbType.Image);
param1.Value = ImageContent;
sqlUpload.Parameters.Add( param1 );SqlParameter param2 = new SqlParameter("@.Type", SqlDbType.VarChar, 50);
param2.Value = strFileType;
sqlUpload.Parameters.Add( param2 );SqlParameter param3 = new SqlParameter("@.Length", SqlDbType.Int);
param3.Value = intImageSize;
sqlUpload.Parameters.Add( param3 );SqlParameter param4 = new SqlParameter("@.DocName", SqlDbType.VarChar, 50);
param4.Value = "Test PDF";
sqlUpload.Parameters.Add( param4 );try
{
this.sqlConnection2.Open();
sqlUpload.ExecuteNonQuery();this.Label2.Text = "File Uploaded Successfully";
this.Button2.Visible = true;
}
catch(SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
this.sqlConnection2.Close();
}
}//download file
private void Button2_Click(object sender, System.EventArgs e)
{
try
{
this.sqlConnection2.Open();
SqlDataReader r = this.sqlDownLoadImage.ExecuteReader(CommandBehavior.CloseConnection);if(r.Read())
{
Response.ContentType = r["Type"].ToString();
Response.BinaryWrite((byte[])r["ImgField"]);
Response.
}
}
catch(SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
this.sqlConnection2.Close();
}
}
please any ideas?|||I believe you need to use the Response object's AddHeader method in order to get that to work for you. I don't have any direct experience with that, but this post might help:view post 463798
Terri|||Thanks,
I am getting the same results it won't open in a broswer window when I use inline. I would like this to happen, but does this mean i must save the file first to a spot before I can view it.
If that is true, will it be easier for me to just store the pdf's in a file structure on teh server and have teh database store a path to it?
Thanks|||I am having a similar problem
i am trying to use the example at:
http://aspalliance.com/articleViewer.aspx?aId=140
got the upload working
the download is another story though.
when i use the following code i get a conversion issue
Response.BinaryWrite(myDataReader.Item("PersonImage"))
it says that with option strict on, i can not make an implicit conversion from system.object to a 1-dimensional array of Byte.
this is driving me crazy and all the above is way beyond me - as a beginner in this arena|||Instead of this:
Response.BinaryWrite(myDataReader.Item("PersonImage"))
try this:
Response.BinaryWrite(CType(myDataReader.Item("PersonImage"), Byte()))
That should explicitly do the conversion to a byte array.
Terri|||
Terri is a Stud!!!!!!!
That worked FOR ME
Tuesday, February 14, 2012
Cannot connect to MSOLAP Provider
Server on a different box. The code that is not working is:
Dim cat
Set cat = Server.CreateObject("ADOMD.Catalog")
cat.ActiveConnection = "Data Source=asServer;Initial
Catalog=MyMart;Provider=msolap;"
My environment is:
The web server box (Server A) : Windows 2003 Server with IIS6, SQL
Server Client sp3 and Analysis Service Client sp3 are both installed.
All other asp pages not using ADOMD all work fine. Most of the web
applications on this server are ASP.NET.
The AS Server box: Windows 2000 with SQL Server 2000 SP3 (8.00.760)
The problem page works fine on other Windows 2000 server with IIS 5.
And the strange thing is: from Server A, the MDX Sample Application
works fine.
Any help is greatly appreciatedHello Tommy,
I noticed that the issue was posted in several groups
(microsoft.public.sqlserver.olap, microsoft.public.sqlserver,
microsoft.public.sqlserver.datawarehouse
)._ I have added a reply to you at
http://msdn.microsoft.com/newsgroup...t.public.sqlser
ver.olap&lang=en&cr=US
If you have follow up questions, please post there and I will work with
you. Thanks.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Cannot connect to MSOLAP Provider
Server on a different box. The code that is not working is:
Dim cat
Set cat = Server.CreateObject("ADOMD.Catalog")
cat.ActiveConnection = "Data Source=asServer;Initial
Catalog=MyMart;Provider=msolap;"
My environment is:
The web server box (Server A) : Windows 2003 Server with IIS6, SQL
Server Client sp3 and Analysis Service Client sp3 are both installed.
All other asp pages not using ADOMD all work fine. Most of the web
applications on this server are ASP.NET.
The AS Server box: Windows 2000 with SQL Server 2000 SP3 (8.00.760)
The problem page works fine on other Windows 2000 server with IIS 5.
And the strange thing is: from Server A, the MDX Sample Application
works fine.
Any help is greatly appreciated
Hello Tommy,
I noticed that the issue was posted in several groups
(microsoft.public.sqlserver.olap, microsoft.public.sqlserver,
microsoft.public.sqlserver.datawarehouse
).X I have added a reply to you at
http://msdn.microsoft.com/newsgroups...public.sqlser
ver.olap&lang=en&cr=US
If you have follow up questions, please post there and I will work with
you. Thanks.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Cannot connect to MSDE from C# code
I'm new to C#, and I appologize for this basic question.
I am trying to connect to an SQL database from a very short C# program, which I found on the Microsoft site, demonstrating this subject.
Here is my setup:
Windows 2000 Professional
dotNET Framework 1.1 with sp1 installed
MSDE 2000
Note: I do not own nor do I have Visual Studio.NET of any kind installed.
Now, here is what works:
osql -E -S localhost\vsdotnet
1>
And I can create and populate a database, which I called mydb.
Now, in my simple C# demo program I have this line
SqlConnection mycon = new SqlConnection("server=localhost;database=mydb;trusted_connection=true");
And the program compiles OK using "csc" command. But when I run it, I get this message:
Couldn't Open Connection to server=localhost;database=mydb;trusted_connection=true
Could anybody comment on what am I missing?
Thanks.The complete answer can't be given without knowing if you chose to use intgrated NT security or not during the MSDE installation. Either which way your connection string is incomplete.
If you installed MSDE using NT integrated security your connection string should also contain: Persist Security Info=False;Integrated Security=SSPI;
If not you will have to provide a username password pair such as:
uid=sa;pwd=secret;
Hope this helps
Cheers
Gary
Sunday, February 12, 2012
Cannot connect to Local SQL Server
Explorer or vb.net code. The problem is connected to the Norton Internet
Security 2005 Firewall as when I disable Norton everything works and if
Norton is enabled but the PC is not plugged into the network it also works.
When I am connected to the network the Firewall does pop up asking whether
or not I want to allow my vb.net program to access a DNS. I have tried using
localhost, the hardcoded IP of my machine, and my machine name (the usual
method) without any success. It is as if Visual Studio always tries to
resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
Enterprise Manager all work fine at the same time Visual Studio/VB.Net does
not.
Any ideas?
Thanks,
Mark Lewis
mdlewis@.mdlewis.com
P.S I am using the latest production/old Visual Studio and SQL Server on XP
with all SP applied.here's an idea: configure the Norton product so that your machine can access
DNS.
-- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>|||Resubmitting this with my new MSDN Alias.
Thanks,
Mark Lewis
mdlewis@.mdlewis.com
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>|||Resubmitting this with my new MSDN Alias to qualify for support.
Thanks and sorry about the double post,
Mark Lewis
mdlewis@.mdlewis.com
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>
Cannot connect to Local SQL Server
Explorer or vb.net code. The problem is connected to the Norton Internet
Security 2005 Firewall as when I disable Norton everything works and if
Norton is enabled but the PC is not plugged into the network it also works.
When I am connected to the network the Firewall does pop up asking whether
or not I want to allow my vb.net program to access a DNS. I have tried using
localhost, the hardcoded IP of my machine, and my machine name (the usual
method) without any success. It is as if Visual Studio always tries to
resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
Enterprise Manager all work fine at the same time Visual Studio/VB.Net does
not.
Any ideas?
Thanks,
Mark Lewis
mdlewis@.mdlewis.com
P.S I am using the latest production/old Visual Studio and SQL Server on XP
with all SP applied.
here's an idea: configure the Norton product so that your machine can access
DNS.
-- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>
|||Resubmitting this with my new MSDN Alias.
Thanks,
Mark Lewis
mdlewis@.mdlewis.com
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>
|||Resubmitting this with my new MSDN Alias to qualify for support.
Thanks and sorry about the double post,
Mark Lewis
mdlewis@.mdlewis.com
"Mark Lewis" <mdlewis@.mdlewis.com> wrote in message
news:u$P2swmHFHA.3336@.TK2MSFTNGP10.phx.gbl...
>I am having trouble connecting to my local sql server from either the
>Server Explorer or vb.net code. The problem is connected to the Norton
>Internet Security 2005 Firewall as when I disable Norton everything works
>and if Norton is enabled but the PC is not plugged into the network it also
>works.
> When I am connected to the network the Firewall does pop up asking whether
> or not I want to allow my vb.net program to access a DNS. I have tried
> using localhost, the hardcoded IP of my machine, and my machine name (the
> usual method) without any success. It is as if Visual Studio always tries
> to resolve the machine name and cannot. VB6 programs ,dbArtisan, and SQL
> Enterprise Manager all work fine at the same time Visual Studio/VB.Net
> does not.
> Any ideas?
> Thanks,
> Mark Lewis
> mdlewis@.mdlewis.com
> P.S I am using the latest production/old Visual Studio and SQL Server on
> XP with all SP applied.
>
cannot connect to database: Login failed for user
When I try to connect to database I get this error message: Login failed for user 'databaseadmin'.
My connection code is:
Dim MyConnection As New SqlConnection( _
"server=(local); database=news; UID=databaseadmin; PWD=111111;")
I've tried "server=localhost:3066", and "server=." and many many other ways, but it's still not working! I don't know what other things should I try now... I asked the support people of my web host, and their answer is:"Mysql database usename and password is corect one. It seems that there is problem with the script code."
Please would anybody help me with this? Thank you very much!
If you are trying to connect to your web host's database server then the server should be something other than local. Also, you said the support people's answer is "Mysql database ...". You are using SQL Server not MySQL, right?
-Mike
|||Thank you so much for your reply!Yes it is Microsoft SQL Server I'm using. The web host gave us some choice when adding a new database, and I also added another database which is using MySQL Server, and it didn't work neither...
Sorry I'm new to ASP.net, so I don't know what should I put for "server" if I'm working with the web host's database server? I tried to give it the IP address of my web host, but it didn't work...
Would you please give me some further assistance on the code? Thank you!|||For your information, after I login to phpMyAdmin I get this welcome message:
MySQL 4.1.7 running on localhost:3306 as databaseadmin@.localhost
Don't know whether this helps...
I'll really appreciate if someone could help me with this problem, thank you in advance!!|||Problem solved!
I've added a new MySQL database, and connected to that database using Odbc connection. And it's now working!!