Falling sales and tumbling prices have shredded profits at Dan River Inc., the large textile manufacturer based in Danville, Va.

But the human distress caused by that and other bad economic news may be helping business at A.H. Robins Co. Inc., a Richmond-based drug producer, which yesterday reported record sales and earnings for the second quarter and first half of 1982.

Also reporting was Madison National Bank of Washington.

Dan River reported net earnings of $154,000 (2 cents a share) for the second quarter, down from $4.1 million (71 cents) a year earlier.

The company had an operating loss of $532,000 (11 cents) in the past three months, but was saved from finishing in the red by a gain of $686,000 (13 cents) from the exchange of common stock for debt securities.

For the half, Dan River logged earnings of $1.6 million (27 cents), a steep drop from $7.1 million ($1.23) earned in the first six months of 1981.

Second-quarter sales were $141 million, down from $177.3 million a year ago. Sales for the half were $272.4 million compared with $333.3 million last year.

"It's a rough world out there," Fred J. Zahrn, Dan River's senior vice president for financial administration, said yesterday. Zahrn said his company has been hurt by "significantly lower product demand and lower prices."

"Maybe you've heard. We're in a recession," a harried textile industry spokesman said yesterday when asked if Dan River's performance was indicative of industrywide problems. Unemployment in the domestic textile industry stands at nearly 14 percent, and production is off 16 percent from a year ago.

"We've had a lot of headaches. Maybe that's why the pill people are doing so well," said the spokesman, who asked that his and his association's name be withheld.

Such an understandably chary attitude was not evident yesterday at A.H. Robins.

The drug company's second-quarter profits amounted to $10.9 million (45 cents a share), a 36 percent increase over the $8 million (32 cents) earned last year. Net earnings for the half were 22.2 million (90 cents), up from $21.7 million (86 cents) last year.

Robins' second-quarter sales were $116 million, a 12 percent increase over $103.6 million in the year-earlier quarter. Sales for the half were $224.8 million, up from $218.3 million last year.

Robins President E. Claiborne Robins Jr. said his company's robust second-quarter performance erased a 5 percent drop in sales and a 17 percent decline in earnings in the first quarter of 1982. He said that most of the sales increase for the first half came from the movement of health care products in the United States.

Madison National, the major bank of James Madison Ltd., a holding company, posted second-quarter net earnings of $786,556 ($1.92 a share), a 6.7 percent increase over $734,870 ($1.80) pulled in last year. For the half, the bank registered a 15 1/2 increase in profits to $1.5 million ($3.74) from $1.3 million ($3.24) a year earlier.

Madison's total assets in the second quarter increased by 8.6 percent to $205.6 million from $189.3 million last year. Second-quarter deposits increased to $159.3 million from $157.1 million; and loans increased to $133 million from $114.7 million.