Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all 13329 articles
Browse latest View live

Can't open mdb file

$
0
0
I have a database in mdb format that will not open. When I try to open the file I get an error:
"The Microsoft Access database engine stopped the process because you and another user are attempting to change data at the same time"

I was the only user accessing the database and this occurred after a compact/repair.

Any ideas on how to get the db working again?

I need to know if the table is used by any view

$
0
0
Hi All



I need to know if the table is used by any view ?

because I need to rename table but I got this message

RENAME TABLE X TO Y
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0750N The statement failed because the table or column cannot be renamed.
SQLSTATE=42986

when I search about this error I found that I need to drop any view or trigger related to this table before renaming..

I use db2 v10 "Z linux"

thank you very much

Estimate the number of Tuples from relations

$
0
0
Quick question, and great help if possible: I have an exam tomorrow on a database module which I'm revising for, and one of the past papers had this question:

Quote:

Consider the following three relations:

R1(A,B,C)

R2(C,D,E)

R3(E,F)

with primary keys A, C, and E, respectively.
Assume that R1 has 2000 tuples, R2 has 1500 tuples, and R3 has 800
tuples.

(a) Estimate the size of R1∞R2∞R3 (∞ is a join symbol). [6 marks]

(b) Estimate the size of R3∞R2∞R1 (∞ is a join symbol). [2 marks]
Some of my peers believe the answer to be 0-2000 for both a and b, however some have come up with different answers, and we're not sure which is correct.

What do think for a and b?

Counting records using a WHILE cycle

$
0
0
Hello...

I'm stuck automating the process of counting the amount of records per different department on a table...

I have a table that contains a list of departments (about 50) and another table that contains helpdesk tickets, each record storing the ID of the department sending the ticket. So I'm trying to count how manay tickets per department, I tought of using a subquery and a WHILE cycle but Its just not happening...

I sketch up this query:

Code:

WHILE (SELECT MAX(DepartmentID) AS c FROM dbo.tblDepartment) i < i.c
BEGIN

        SELECT        COUNT(DepartmentID) AS DepartmentCount
        FROM            dbo.tblTask
        WHERE        (DepartmentID = @Variable)

END

Clearly not doing anything.... Any ideas o how could I build this query or what better way of doing the job there are...

Multiple Choice Test DB

$
0
0
I am trying to create a multiple choice test database to manage the test bank, produce tests, and track test statistics. Can someone please point me towards a resource for how to set this up. I am versed in Microsoft Excel, but access is a beast.

Thank you.

Respectfully,

Andrew

Heat Map Help

$
0
0
I can put icon on top of a image save data into table


MapID PK
MAP = filename.pnp
Icon = the Icon (metal,Glass,Hole,bla,bla,bla
Plotx = percentage down from top of map
Ploty = percentage from right
ADate = date plotted
comments =

I can print the report which plots the icon on top of the map base on its Ploty% and Plotx%

why percentage if change the size of the map if stays the same place :).

Looks A miss when I have Heaps of icons on the Maps in one place

SO............................................

I want to create a Heat map

what i have done is all done in QuerySSSSSSSSSS so far

Just the X plot

GroupX = int(Plotx * 10) so this is a number 1 to 10

now Groupby the Map and count the numbers of GroupX happy tell me how many in each 10th of the map

now i find the Min and the Max base on the groupby of the map Now I know the Heat of it ie close to the Max the HOTTER it is

did the same for the Y point

and HAPPY CAMPER

BUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

what I want help with is

Ploting the GroupX and GroupY and I get a total in that square this is where im brain dead



any Ideas
have I miss something

psql function

$
0
0
Hi ,
I want to pass a tablename as a parameter in psql function and fetch data . Any way to do that !!

Leading zeros in table! PLEASE HELP

$
0
0
Hello everyone,

I have a problem with a field in one of tables. There are leading zeros and i need to get rid of them in order to successfully join this table. However, i have tried so many query expressions (CLng, Clnt, Val,) and they delete all of the zeros, leading and trailing.

I only want to delete the leading ones. Please help this is becoming a nightmare.

I made this function in excel hoping that i could adapt it to Access by using mid but it doesn't seem to work either:

=IF(LEFT(B2;3)="000";MID(B2;4;4);IF(LEFT(B2;2)="00 ";MID(B2;3;4);IF(LEFT(B2;1)="0";MID(B2;2;4))))

Access:
Poste k: VraiFaux(Gauche([En_Cours_Cdes_Forcaste]![Poste];3)="000";ExtracChaîne([En_Cours_Cdes_Forcaste]![Poste];4;4);VraiFaux(Gauche([En_Cours_Cdes_Forcaste]![Poste];2)="00";ExtracChaîne([En_Cours_Cdes_Forcaste]![Poste];3;4);VraiFaux(Gauche([En_Cours_Cdes_Forcaste]![Poste];1)="0";ExtracChaîne([En_Cours_Cdes_Forcaste]![Poste];2;2))))

Its in french but its the same thing and it gives me the same results i.e taking out the trailing zeros.

Design physical data model on Sybase IQ

$
0
0
Hi guys,
I am very new to sybase. We use Sybase IQ in Data warehouse, there are 3 layer: staging layer (using sybase ase) -> data warehouse layer (3NF, using sybase iq) -> datamart layer (dimension model, using sybase iq). We only one server for sybase iq, should i create one or two database for data warehouse layer and datamart layer ?

More,we want remain 2 year data on fast disk and 3 year older data on slow disk. How design physical data model ? How partitioning ?

Thanks

Sqlcode: -30090, sqlstate: 25000

$
0
0
Hi,

I am trying to update a federated database table . I m getting this error often. once it will execute successfully & suddenly it will terminate with the below error.

error:
Deploy R.T_E
Running
R.T_E - Deploy for debug started.
DB2 SQL Warning: SQLCODE=100, SQLSTATE=02000, SQLERRMC=null, DRIVER=4.17.30
R.T_E - Deploy for debug failed.
11
R.T_E - Roll back failed.
Error - SQLCODE: -30090, SQLSTATE: 25000

can someone kindly let me know what is this error & how to overcome this.
I am using db2 c express on windows & linux. I m getting the same error on both platforms. I m having SYSADM authority.

Thanks

Scheduling Database Design

$
0
0
Good afternoon,

I am a novice when it comes to database programming, but I would like to implement my idea (that I'd like your input on), as a way to learn SQL databases.

Background:
In my line of work, we have a small number of employees who visit customer sites, and at the moment, we schedule their work using an excel spreadsheet that is sent out by email to the employees each week. The spreadsheet is in the format of:
schedule layout.gif
This works fine, but there are a number of annoyances with this method.
Firstly, any changes to the schedule after it is sent, are not visible to the employees when on the road.
Secondly, if an employee changes their schedule, they cannot update the spreadsheet whilst on the road, and have to 'phone in' changes they have made.

The Idea:
My idea is to create an SQL database to store the employee schedule information and a web front end to display it online.
From my initial research into this, I believe I need to use SQL tables to include the following information:

  • Employee Name
  • Date
  • Day of the Week
  • Morning Customer Name
  • Morning Work Type
  • Afternoon Customer Name
  • Afternoon Work Type
  • Any additional notes


I'm sure that there would be other useful data that could be included, such as holiday allowance etc. but this might be something I could incorporate at a later date, unless creating all fields at the beginning be a better way to do it?

I am quite happy programming a web front end, and reasonably happy with C#.net to populate the front end (once I have figured out how to put data into and out of the SQL database).


Any input you can give would be greatly appreciated.

Oliver
Attached Images

Set Focus properly...?

$
0
0
Private Sub cmd_lagre_Click()


So, i got the msg box and everything to work out fine, but the set focus wont work. It probably is kinda easy, and misplaced, but my mind just wont work with me on this one.

The first msg box is affected by a chiose in the sub_form, and the second on a choise in the main form. I would like to set focus, depending on which msg appears =)

Dim Feilstreng As String


On Error GoTo MyErr

If Me.sub_form.Form.Rek And IsNull(Me.sub_form.Form.RekNr.Value) Then


Feilstreng = Feilstreng + "msg msg msg" + vbNewLine


Me.sub_form.Form.RekNr.SetFocus


End If


If Len(Me.comb_rom.Value & " ") < 2 Then

Feilstreng = Feilstreng + "- Du har glemt å fylle ut rom" + vbNewLine

Importing Mass Images linked by ID number

$
0
0
Good morning,
I have been researching and I cannot find any guidance on how to import mass pictures to records using a field identifier. I have File Maker Pro experience and have a database where a script automatically populates the records using the Student ID number. I have over 2500 student pictures. I have a user form that has student information and I want to link the picture to their perspective student info. Everything I have found shows a button on each record that imports that picture. That would take awhile. Can anyone guide me to a place that will show me how to do it?

So I should be able to click on button and each record is populated with the correct student picture linked by their Student ID. Hope this is possible.

Scheduled Automation

$
0
0
I have a report that management wants automatically e-mailed to them two times per day.

I configured a database to open to a form that runs code on open to email the report. The vba works perfectly.

I created a task in Task Scheduler, selected to run even when I'm not logged on. Everything works when I am logged on, but when I'm not logged on, it opens my database but does not run the vba. I log in and see that the task completed, I have the "lock file" indicating that my database is open, but when I look in task manager it's using 0% CPU, just not doing anything.

Here are the methods I've tried:
1. .bat file
Code:

cmd.exe /c "PATH TO MY DATABASE FILE"
2. .vbs file
Code:

Dim sAcc
Dim sFrontEnd
Dim sSec
Dim sUser
Dim objShellDb
Dim sComTxt
 
sAcc = "C:\Program Files\Microsoft Office\OFFICE15\msaccess.exe"
sFrontEnd = "PATH TO MY DATABASE FILE"

Set objShellDb = CreateObject("WScript.Shell")
'Build the command to launch the database
sComTxt = chr(34) & sAcc & chr(34) &_
        " " & chr(34) & sFrontEnd & chr(34)
if isNull(sSec)=False AND sSec<>"" Then
        sComTxt = sComTxt & " /wrkgrp " & chr(34) & sSec & chr(34)
End if
if isNull(sUser)=False AND sUser<>"" Then
        sComTxt = sComTxt & " /user " & sUser
End if
objShellDb.Run sComTxt 'Launch the database

3. I have tried running msaccess.exe from task scheduler with the path to my database in arguments.


All methods return the same result. How do I get my vba to run through Task Scheduler when no users are logged in?

Processing A LARGE Table Sequentially using DB2 on the IBM I

$
0
0
I am trying to pull information for specific transactions from our FedEx server transmission file on the IBM I. The record length is 32,766 characters and there can be several hundreds of thousands of records on the file. I need to pull specific shipping transactions and the records must be read in the right sequence or the data will be interpreted improperly. I am using the following to ensure the records are processed sequentially:

exec sql declare web cursor for select
substr(webapit,1,1000), rrn(webapit) from webapit
where substr(webapit,1,100) like :webshipmentid
order by rrn(webapit);

As the file grows, the response time gets worse. There are several users that will be accessing this program and all of them will be trying to re-arrange this huge file by rrn. I need another option. Can anyone provide a faster solution? Note: I am running the sql embedded in an RPG program.

Thank you

Got a job that uses SQL server, foolish for me to accept?

$
0
0
I have used sql in Access some. you dont really need to in that program much.

But i have done/used all the basics in this before on the job except some of the table building features.
http://www.w3schools.com/sql/default.asp

I was offered a really good job at a top company that uses Sql server and sql management studio to pull the data.

The way i think i got it, is because all of the analysis they have done, i have personally done myself in Access. and the sql skills never came up to much.

So, if i give myself a month prior to starting, do you think if i cram 3 hours a day for that month. I can get up to speed to functionally do the job some on day 1. and with my continuing studying be good to go 2-3 months in?

or is this just foolish on my half?

db2 snapshot restore to new db in other instance

$
0
0
DB2 10.5 FP 5 on Suse Linux using Netapp
We are considering implementing snapshot backups on our production database and would like, as part of that, to be able to restore to a db in another instance/server. I'm familiar with cross node restores using TSM but when I had a look at the db2acsutil command and other doco I can't see how to make the snapshot backup available for the restore in another location or is it 'normally' always available - seems a bit insecure - does it require a shared ACS repository?

Issues with syntax and performance.

$
0
0
Hello,

I have got T-SQL query here and would like to know is there any issues with the following TSQL statement in terms of syntax and performance. I really appreciate help here. Thanks.

SELECT
*
FROM
TableA NOLOCK
LEFT JOIN TableB ON TableA.ID = TableB.ID
WHERE
TableB.Week = 2
AND dbo.fn_GetTime(TableA.TimeCode) = '14:00'
GROUP BY
TableB.DAY
ORDER BY
Week

Duplicate rows with a column content

$
0
0
I would like to use Access in order to duplicate the content of a list of values into new rows based on the content of a column.

Here is an example below:

List1 List2
A 1
B 2
C 3
D 4
E 5
F 6
G 7

Duplication
A1
A2
A3
A4
A5
A6
A7
B1
B2
B3
B4
B5
B6
B7
Etc

How can I achieve this in Access?

Combining records

$
0
0
Great Day!

I have a database with about 800,000 records. Some of these records, about 30,000 need to be combined into a single record in a query. The first selection field is called "Route_ID", the second is the MR ID and the third is the "Read_Date" field. If the Route ID and MR_ID in record 1 and record 2 match AND the Read_Date in Record 1 is within -3 days (allows for the weekend) of the Read_date in Record 2, I need to combine those two records.

The Read Date Field would be the record 1 data, I have other fields, like [Hours] that would need to be added. In the dataset below I would want to combine records 2 and 3.

Route ID MR ID Read Date Download Date Actual Reads Hours Minutes Percentage Complete
43R1138W C8034 17-May-15 21-May-15 42 43 1 6 7.91
42R4291W C7937 14-May-15 21-May-15 126 42 2 17 13.64
42R4291W C7937 15-May-15 21-May-15 639 42 6 6 69.16
50C1327W C7480 15-May-15 21-May-15 375 50 2 45 54.43


The combined record should be:
42R4291W C7937 14-May-15 21-May-15 126 84 8 23 99.80


The results of this "Merge Query" will be used as the base for further queries. If the minutes exceed 60 that is not an issue.

Thanks!

Doug
Viewing all 13329 articles
Browse latest View live