Hello, I'm having a problem connection to an Eval version of SQL Server 2000. I'm pretty sure the problem is not due to Eval version since...well, I need to evaluate the server if I intended to purchase it right? anyhow. I've loaded a copy of SQL server 2000 on my local machine. I only have one machine which I use for development and housing SQL Server.
I tried to set SQL up real "vanilla" and elected to use only Windows Authentication, this bypassing any userdefined passwords for the sa login.
Now...I've written a real basic Stored Procedure to test the connection and verify proper data transfer from the .aspx page. here's the SP SQL code and the .vb code behind page as well as the error I get. Note. I also tried Query Analyzer and was getting an error there as well indicating the SP could not be found...hmmm..
stored procedure:
CREATE PROCEDURE [dbo].[NewMemberInsert]
@UserNamevarchar(100),
@UserPassvarchar(10)
AS
INSERT INTO EEMemberList ( UserName, UserPass )
VALUES ( @UserName, @UserPass)
GO
.vb code behind
Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents lblUserName As System.Web.UI.WebControls.Label
Protected WithEvents lblUserPass As System.Web.UI.WebControls.Label
Protected WithEvents txtUserName As System.Web.UI.WebControls.TextBox
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents frmMyForm As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents sqlCmd As System.Data.SqlClient.SqlCommand
Protected WithEvents txtUserPass As System.Web.UI.WebControls.TextBox
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
Me.sqlCmd = New System.Data.SqlClient.SqlCommand()
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'THIRDEYEASPNET'.
Source Error:
Line 54: sqlCmd.Parameters("@UserPass").Value = txtUserPass.Text
Frustration has gotten the best of me on this one. Can anyone help? I need to pass the current value in an Access Data Project (back-end is MS SQL) text field to the where condition in an SQL using VBA. This is what I have, but does not work.
Private Sub Command44_Click() Me.SS.SetFocus Dim strSQL As String Dim strSSecurity As String strSSecurity = Me.SS strSQL = "Update Employees Set employees.PositionID = '',employees.jobcode = '' Where employees.ss = strSSecurity" DoCmd.RunSQL strSQL End Sub
It is supposed to take the current Social Security number from the form and match it against the employees table. Once it finds the matching record it should update the PositionID and JobCode fields to '' (empty string) But it doesn't Anyone with any ideas? Thanks Dan
Hi there...I use SQL server integrated security so when a user opens a database inaccess it prompts the username & password in a small popup box onconnection, but I'd like to use my own customised form for theauthentication process, is this possible? I do know that this login popboxis displayed before any forms are loaded, can it be said that on databaseconenct that the form is opened? How will I transfer the values entered intothe login form to the sql server for authentication?Thanks alot in advanceRudi Groenewald
I'm trying to import data from Access table using DataFlow with TransactionOptions- Required. I just want to "remove" (rollback) all records which my SSIS Dataflow inserts into SQL Server. First I tried to use normal Jet 4.0 provider - but it causes strange error. Then I tried to use .NET Jet 4.0 provider - it produces this error :
Code Block
[DataReader Source [540]] Error: System.InvalidOperationException: The ITransactionLocal interface is not supported by the 'Microsoft.Jet.OLEDB.4.0' provider. Local transactions are unavailable with the current provider. at System.Data.OleDb.OleDbConnectionInternal.EnlistTransactionInternal(Transaction transaction, Boolean forcedAutomatic) at System.Data.OleDb.OleDbConnectionInternal.EnlistTransaction(Transaction transaction) at System.Data.OleDb.OleDbConnection.EnlistTransaction(Transaction transaction) at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String connStr, Object transaction) at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction) at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction) Any ideas how to do this? I really need transactions in my solution. With Excel file it works fine. Thanks for help.
I have created a relatively simple SISS package for MS SQL server 2005 SP1, the package runs without issue when started from the development environment, but fails when ran via a SQL Job.
I have other SISS jobs which run without any problems, the difference with this one is that it doesn€™t just access data the the MS SQL server databases, but it also accesses an external MS Access 2003 database (emptys tables then repopulates based on data in MS SQL)
The database is held on a network share, so I would imagine the issue is that the SQL job is ran under a different security context. Originally it was ran under €œSERVERNAMESYSTEM€?, but I created a new credential on the server giving it my own username and password, I then added a proxy to the server which used the new credietial and was given access to all sub systems.
The SQL job step was setup to run under this proxy, but still failed even though the user name on the credentials had access to the MS Access database on the network share & also matched the package CreatureName, allowing the data to be read as EncryptSensitiveWithUserKey was set in the package.
The SISS package was created by using the wizard, no ODBC connection was setup on the server. The job history shows €œExecuted as user: ADMINusername. The package execution failed. The step failed.€? I have also tried this with a protection level of ServerStorage
I have a windows based software application that connects remotely to a sql server 2005 and calls stored procedures. There is someone that I work with that is cautioning the company strongly that this is a bad thing to do in terms of security. Isn't this a very common thing to do? Assuming that the SQL Server installation is setup appropriately. Is this a bad practice?
I have a combo box named [myControl] on an Access form that I can use to select/enter a site name (ABC). There is a button on the same form that runs a report. The underlying record source for the report is a SQL Function. Is there an easy way to pass the combo box value to the SQL Function so that only records for site 'ABC' are displayed in the report? I tried Forms![myForm]![myControl] in the criteria box of the Function and it did not work. THANKS!
I have a whole bunch of forms that have an unbound StartDate and anEndDate field that I have used in MSAccess MDB databases as parametersin queries (ie tblEvent.StartDate > Forms!myFormName.StartDate.)So, now I'm migrating this beast over to and ADP/SQL Server projectusing Views and Procedures.How do I pass the value in Forms!myFormName.StartDate to a Procedureand get something that looks like:If tblEvent.StartDate > Forms!myFormName.StartDate then ...Any help is GREATLY appreciated. This is a major problem before I canmove ahead with this beast!lq
I am trying to filter the records in an Access2003 project form using data from a control in a different form. I define the variable in form1 as RegKeyWord. The record source for form2 ends with WHERE CustomerName Like RegKeyWord. I receive the error Invalid column 'RegKeyWord' Can anyone help?
I have a database in ACCESS and i want everytime that there is a change made in Access the cude in SQL server to be automatically updated .Is there a way that this can be done with Integration Services?
I like to give First Name and Last Name in two different text box and then hit the delete button (command button). Then it will do a query to find the person and delete the corresponding record from the table. Any kind of help will be appreciated. Thank you.
I just changed my Access 2002 database to a SQL Server ADP project. Ihad a form where the user entered a value into a text box and when acommand button on the form was clicked a Report was opened. The reportsrecord source is a query. The query uses the value from the form textbox to restrict the query.Table name = EggsTableone of the columns in the table is named: EggColorForm name = EggColorFormForm text box name = ColorTextBoxThis sql worked for the query before I converted to SQL:SELECT EggsTable.EggColorFROM EggsTableWHERE (((EggsTable.EggColor)=[Forms]![EggColorForm]![ColorTextBox]));This no longer works. Can I change the syntax somehow to get this towork? I tried dropping the brackets around the word "Forms", I trieddropping all the square brackets, etc., nothing worked.I also tried just opening the report with the report's Server Filterproperty set to:EggColor=N'Forms.EggColorForm.ColorTextBox'I tried using the Report's open event to pass the form value directlyto the report. I tried setting a variable from the text box value onthe form. So far, nothing works. Any ideas?
Hello, My company Intranet has a form that agents can use to post their comments about the company to upper management, but our customer service department would like to modify the form so that the agent has to pick from a comment type. The dropdown options on the form will be as follows: ComplimentsComplaintsGeneral CommentsSuggestions Each dropdown option has a designated table in a SQL DB.Using postback on the same page, I need to change which fields of the form are visible based upon which dropdown selection the user chooses, and I need the fields to then be inserted into the table that corresponds with the dropdown selection item. For example: If the Compliments dropdown selection is picked, I need a text box to show for the user's location, the name of the customer, account number, and the message box. Once the submit button is clicked, the characters in these boxes need to be inserted into the Compliments table using its data adapter. However, if the user selects Suggestions, the name of the customer and the account number should not be visible, since these fields do not exist and when the submit button is pressed, the Suggestions table should be updated. If you need more information, I will provide whatever is needed. As always, thanks for everyone's assistance. Chris
Hi, I got a problem. I installed Microsoft SQL Server Management Studio Express 2005 version. And I created a Compact database. I created an connection in SSMSE to connect the database and opened a query form. then, i run the following sql:
Select * from Table1
It returned 3 records to me. After that, I used program to insert record into this table. Then i ran this sql again, it still show me 3 records. I closed the query form, and re-created a new query form, then run the sql, it returned 4 records to me.
Why? It's very strange and difficult to operate, right? Is there anyone know how to make the SSMSE to return whole records without any close query form and re-create query form operation?
Hi everyone, What is the main difference between first form normalizations and second form normalization ? In my opinion, they are both generated for the same operation which is to prevent redundancy(in other words; duplication of data in several records). So would you please explain it to me ?
HiI have a Platinum database which stores dates in integer form e.g the dateis formatted as below:Column_name Type Length Precision------------------------------ ------------------------------from_date int 4 10Some of the dates in the Platinum database are as follows:729115729359730059730241730302730455How can I bring them into SQL 2000 as valid dates.Thanks for your assistanceSam CJoin Bytes!
I am trying to add records to SQL database, thru <form> </form> on click of button, The system is working fine, Databse table is getting updated correctly. But screen displays the same form again while i want it to open another asp.net page i.e. buy.aspx and also generate an e-mail automatically. I m stuck. Please help. pcg
Relevent code of mine is as below. <script runat="server"> void addtosalelist(Object sender, EventArgs e) { .... .... dbConnection.Open(); .... .... dbConnection.Close(); }
SELECT @topicList that produces a list of all the topic_names in the database seperated by commas. That's fine.
I couldn't follow all the code in this thread (http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=18363) but I was able to extract and modify this code:
DECLARE @topicList varchar(200)
SELECT MAB_topics.topic_name INTO #tmp FROM MAB_topics, MAB_articleIndex WHERE MAB_articleIndex.article_ID = 76 AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID
SELECT * FROM #tmp
drop table #tmp which returns the two topic_names that I'd expect. (Note: this is my very first day declaring variables and using temp tables.) So I keep thinking that the following code would combine the two above working functions. But, when I run it in Query Analyzer, it just returns "(2 row(s) affected)" instead of a recordset.
DECLARE @topicList varchar(200)
SELECT MAB_topics.topic_name INTO #tmp FROM MAB_topics, MAB_articleIndex WHERE MAB_articleIndex.article_ID = 76 AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID
drop table #tmp What am I doing wrong? I'm sure it's something simple but I've been reading and trying and reading and trying for a few hours and haven't gotten it yet. The ideal response would figure out what I'm trying to do as well as what my mistake is and explain how I'm misthinking. A close second would be just fixing my code. :)
HiI am using Visual Web Developer 2005 Express and SQL Server Express 2005.From Northwind I can display data to Gridview.Could someone point me in the right direction on two points.How do I start a new database (.mdf) - I cannot find this option.I can change Northwind around - but I want to start my own database. Once I have that sorted - how can I "insert" data into database using a dropdown box?A "dropdown" box such as you would find online. Thanks in advance.Stephen
I need to make a query to a SQLserver db passing values from a dropdownlist and two text boxes as my criteria. Now if nothing is selected and the button is pressed, I would like to return everything that is part of my Select statement. I am having trouble making my sql statement work.
Im sending you my code as an attachment. I've put * around the area i really need help with.
Even if you could just point me in the right direction as to where to look for a good web forms book using VB.NET and ASP.NET I would really appreciate it.
Thanks,
Jose AIM- RangerBud249 Yahoo- RangerBud249
Imports System.Data.OLEDB Imports System.Data Imports System.Data.SqlClient Public Class Test Inherits System.Web.UI.Page Public dbConn As SqlConnection Public da As SqlDataAdapter Protected WithEvents txtStart As System.Web.UI.WebControls.TextBox Protected WithEvents txtEnd As System.Web.UI.WebControls.TextBox Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents img_cal1 As System.Web.UI.WebControls.ImageButton Protected WithEvents img_cal2 As System.Web.UI.WebControls.ImageButton Public ds As DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'the TailNumber is the first thing that will load If Not Page.IsPostBack Then lstAircraft.DataSource = GetAircraft() 'this function will load the Tail Numbers lstAircraft.DataValueField = "TailNumber" lstAircraft.DataTextField = "TailNumber" lstAircraft.DataBind() End If End Sub
Function GetAircraft() As System.Data.DataSet 'this function will load the Tail Numbers Dim connectionString As String = "connection info" Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT [Aircraft].[TailNumber] FROM [Aircraft]" Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter dataAdapter.SelectCommand = dbCommand Dim dataSet As System.Data.DataSet = New System.Data.DataSet dataAdapter.Fill(dataSet)
Return dataSet End Function
****************************************************************************************************************** this is the area I really need help with
Sub btm_Submit_Click(ByVal sender As Object, ByVal e As EventArgs) Dim connectionString As String = "connection info" Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString) dbConnection.Open() dbConnection.Close() Dim selection As String Dim startTime As String Dim landingTime As String Dim flights As String
Dim selString As String = "SSELECT AircraftID, fromLocation, startTime, toLocation, landingTime, ID, Filename, VSU, local_1 FROM Flights, tbl_FileNames, tbl_VSU"
Dim commandString As String = "SELECT [Flights].AircraftID, [Flights].fromLocation, [Flights].startTime, [Flights].toLocation, [Flights].landingTime, [tbl_FileNames].ID, [tbl_FileNames].Filename, [tbl_FileNames].VSU, [tbl_FileNames].local_1 FROM Flights, tbl_FileNames, tbl_VSU"
selection = "where " & Me.lstAircraft.SelectedValue.ToString & " " & startTime = Me.txtStart.Text & " " & Me.txtEnd.Text = landingTime & " " & [Flights].[ID] = [tbl_VSU].[flight_id]) AND [tbl_VSU].[filename_id] = [tbl_FileNames].[ID]" If Me.txtStart.Text <> "" Then selString = selString & selection End If Session("SelStr") = selString
Dim dbCommand As New OleDbCommand(commandString, dbConnection)
DataGrid1.DataSource = GetFlights(lstAircraft.SelectedValue) DataGrid1.DataBind() End Sub *********************************************************************************************************************
Function GetFlights(ByVal ID As Integer) As System.Data.DataSet Dim connectionString As String = "connection info" Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT [Flights].[toLocation], [Flights].[startTime], [tbl_FileNames].[ID], [Flig" & _ "hts].[fromLocation], [tbl_FileNames].[filename], [tbl_FileNames].[Local_1], [Fli" & _ "ghts].[AircraftID], [Flights].[landingTime], [tbl_FileNames].[VSU] FROM [Flights" & _ "], [tbl_FileNames], [tbl_VSU] WHERE (([Flights].[ID] = [tbl_VSU].[flight_id]) AN" & _ "D ([tbl_VSU].[filename_id] = [tbl_FileNames].[ID]))" Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter dataAdapter.SelectCommand = dbCommand Dim dataSet As System.Data.DataSet = New System.Data.DataSet dataAdapter.Fill(dataSet)
Return dataSet End Function
Private Sub img_cal1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_cal1.Click 'this will make the calendar for start visible when clicked and not visible if clicked again Session("Cal1") = True Session("Cal2") = False Me.Calendar1.Visible = True End Sub
Private Sub img_cal2_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_cal2.Click 'this will make the calendar for end visible when clicked and not visible if clicked again Session("Cal2") = True Session("Cal1") = False Me.Calendar1.Visible = True
End Sub
Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged 'this will put the date selected in my text box as a short date If Session("Cal1") = True Then txtStart.Text = Calendar1.SelectedDate.ToShortDateString Session("Cal1") = False ElseIf Session("Cal2") = True Then txtEnd.Text = Calendar1.SelectedDate.ToShortDateString Session("Cal2") = False End If Me.Calendar1.Visible = False
Can anyone help me with this problem? I have a form with three drop down lists. From these lists, the user selects an accountID, the territory that ID is from, and the territory that ID is transfering to. Upon submission, that account number is inserted into the table, along with the TerritoryID, RegionID, DivisionID, and EmpID associated with both of the territories selected. However, upon running this, the accountID and ToTerritory info are inserted once, but the FromTerritory data is inserted tens of thousands of times. Although they are not entered into the same record, which i eventually want to happen, i do want to figure out why so many duplicate entries for the FromTerritory are entered. Here is my code and the stored procedure to enter the FromTerritory. I would appreciate any help. -------------------------
Sub InsertData()
Dim sql as string
dim sql1 = "insertaccounttransfermike 'AccountID''" & AccNumber.SelectedItem.Value & "'" dim sql2 = "insertaccounttransfermikefrom 'FromTerritory''" & FromName.SelectedItem.Value & "'" dim sql3 = "insertaccounttransfermiketo 'ToTerritory''" & ToName.SelectedItem.Value & "'"
' Create Connection Object, Command Object, Connect to the database Dim conn as New SQLConnection(connstr)
Dim cmd1 as New SQLCommand(sql1,conn) Dim cmd2 as New SQLCommand(sql2,conn) Dim cmd3 as New SQLCommand(sql3,conn)
SELECT Territories.TerritoryID, Regions.RegionID, Divisions.DivisionID, Employees.EmployeeID FROM EndoscopySqlUser.Territories INNER JOIN EndoscopySqlUser.Regions ON EndoscopySqlUser.Territories.RegionName = EndoscopySqlUser.Regions.Region INNER JOIN EndoscopySqlUser.Employees ON EndoscopySqlUser.Territories.TerritoryID = EndoscopySqlUser.Employees.TerritoryID INNER JOIN EndoscopySqlUser.Divisions ON EndoscopySqlUser.Regions.Division = EndoscopySqlUser.Divisions.DivisionID, accounts WHERE ( (EndoscopySqlUser.Employees.DateLeft IS NULL) AND (EndoscopySqlUser.Territories.TerritoryName=@FromT erritory)) GO
I'm running SQL Server 2000. I have an interesting form I am creating for a client which has on it literally 20,500 fields that need to be stored in the system which I then have to create reports off of for statistics and trends.
I'm not sure how I should go about storing that large amount of information in SQL Server with the limitations of the size of a table. Would it be best to create 20 some tables to store it, or is there a better fashion to store it. 90% of the fields are numbers ranging from 0 to 100.
Table name 1 : Income Income RentMonth 1500 Jan 1500 Feb 1500 Apr
Table name 2 : Expense Expense ExpMonth 200 Jan 300 Mar 400 Apr
The result table becomes (Profit=Income-Expense) Profit Month 1300 Jan 1500 Feb -300 Mar 1100 Apr
But I form the query by join the both Income and Expense tables to subtract the Income and Expense month wise.
But one moth is in one table the same month is not in another table.
For Example Feb month is in Income table, but not in Expense table.And Mar month is in Expense table and not in Income table. So how will I form the query to achieve my result table as i indicated above. Kindly help me.
I'm using SQL server on godaddy.com, and for the life of me, tried all freakin day yesterday to get a form to send data to my table, and can't get it to work for the life of me
I think the asp form sends the information to the asp page that is to add the information to the tables correctly, but am not entirely sure, so here is the code for the form:
Now for the page that is giving me the problem (I think). I'm pretty sure I'm fudging up the connectivity somewhere because all I get is an http 500 error every time I try to upload the information.
Why won't it bloody connect?!?!
Also, is the DIM function on this page used to hide important information? If you guys can help me fix this, I'd be incredibly, incredibly greatful, I'm frustrated out of my mind!
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="CP_ACP"%> <html> <head> <title>piece of shit page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <% Dim oConn, oRs Dim qry, connectstr Dim db_name, db_username, db_userpassword Dim db_server
I have a Visual Basic application that connects to a SQL server database. In my application, I have a login screen that is supposed to pause the application (it's coded as modal) and ask the user for a login and password. I have my connection string and user set up to use Windows NT authentication.
However, what is happening with my application is that as soon as I start the program, it never stops at the login screen, but instead goes right into the application.
Is this "normal" when using Windows NT authentication? What causes this behavior? How can I make my program stop at the login screen, and more interestingly, would I want to stop at a login screen?
Thanks in advance to all who reply. This is driving my crazy!
This forum is best viewed with a computer. Questions asked freely. Confusion happily shared.
What I want i, if there is any value in any fields, other null values in the field should be replaced by 0, if all the rows of the filed are null, simply leave as it is....
Like the select statement of this SIM_TempCustomer should give a result like